Skip to content

Instantly share code, notes, and snippets.

@Deaner666
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deaner666/863ea41c8500d122adee to your computer and use it in GitHub Desktop.
Save Deaner666/863ea41c8500d122adee to your computer and use it in GitHub Desktop.
Add author box to all post types (except pages) and then remove it from "Snippets" Custom Post Type
<?php
// Add author box to single posts and author archives
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
add_filter( 'get_the_author_genesis_author_box_archive', '__return_true' );
// And remove it from anything that's not a post
add_action ('genesis_entry_footer', 'wpm_remove_author_box' );
function wpm_remove_author_box() {
if ( get_post_type() == 'snippet' ) {
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment