Skip to content

Instantly share code, notes, and snippets.

@robneu
Last active December 30, 2015 09:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robneu/7811207 to your computer and use it in GitHub Desktop.
Save robneu/7811207 to your computer and use it in GitHub Desktop.
Add entry footer markup for custom post types in Genesis
<?php
/**
* Add support for the genesis entry-footer markup within custom post types.
*
* The default Genesis entry footer markup will only render for standard posts.
* this removes the default genesis markup and recreates it allowing for CPT
* usage in addition to standard posts. Pages are still ignored.
*
* @author FAT Media, LLC
* @link http://wpbacon.com/tutorials/genesis-entry-footer-custom-post-type/
*/
// Remove the default entry footer opening markup.
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
add_action( 'genesis_entry_footer', 'prefix_entry_footer_markup_open', 5 );
/**
* Echo the opening structural markup for the entry footer.
*
* @todo Change 'prefix' to theme prefix.
*
*/
function prefix_entry_footer_markup_open() {
if ( is_page() ) {
return;
}
printf( '<footer %s>', genesis_attr( 'entry-footer' ) );
}
// Remove the default entry footer closing markup.
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
add_action( 'genesis_entry_footer', 'prefix_entry_footer_markup_close', 15 );
/**
* Echo the closing structural markup for the entry footer.
*
* @todo Change 'prefix' to theme prefix.
*/
function prefix_entry_footer_markup_close() {
if ( is_page() ) {
return;
}
echo '</footer>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment