Skip to content

Instantly share code, notes, and snippets.

@About2git
Forked from srikat/functions.php
Created February 13, 2015 21:21
Show Gist options
  • Select an option

  • Save About2git/c408b0cf258c0b540981 to your computer and use it in GitHub Desktop.

Select an option

Save About2git/c408b0cf258c0b540981 to your computer and use it in GitHub Desktop.
Adding the missing Entry Footer markup in Genesis
//* Remove the built-in Entry Footer markup
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
add_action( 'genesis_entry_footer', 'sk_entry_footer_markup_open', 5 );
/**
* Echo the opening structural markup for the entry footer.
*
* Context: Everywhere except on static Pages.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/
*/
function sk_entry_footer_markup_open() {
if ( 'page' === get_post_type() ) {
return;
}
printf( '<footer %s>', genesis_attr( 'entry-footer' ) );
}
add_action( 'genesis_entry_footer', 'sk_entry_footer_markup_close', 15 );
/**
* Echo the closing structural markup for the entry footer.
*
* Context: Everywhere except on static Pages.
*/
function sk_entry_footer_markup_close() {
if ( 'page' === get_post_type() ) {
return;
}
echo '</footer>';
}
//* Remove the built-in Entry Footer markup
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
add_action( 'genesis_entry_footer', 'sk_entry_footer_markup_open', 5 );
/**
* Echo the opening structural markup for the entry footer.
*
* Context: Posts (single and archives) and 'research-papers' CPT pages (single and archives).
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/
*/
function sk_entry_footer_markup_open() {
if ( 'post' === get_post_type() || 'research-papers' === get_post_type() ) {
printf( '<footer %s>', genesis_attr( 'entry-footer' ) );
}
}
add_action( 'genesis_entry_footer', 'sk_entry_footer_markup_close', 15 );
/**
* Echo the closing structural markup for the entry footer.
*
* Context: Posts (single and archives) and 'research-papers' CPT pages (single and archives).
*/
function sk_entry_footer_markup_close() {
if ( 'post' === get_post_type() || 'research-papers' === get_post_type() ) {
echo '</footer>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment