-
-
Save rfmeier/4805035bd30ab7e17f76 to your computer and use it in GitHub Desktop.
Removing entry header for post formats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //* do not include php tag | |
/** | |
* In response to Genesis Support forums | |
* http://www.studiopress.com/forums/topic/removing-entry-header-for-post-formats/ | |
*/ | |
add_action( 'genesis_before_entry', 'possibly_remove_entry_header' ); | |
/** | |
* Callback for Genesis 'genesis_before_entry' action. | |
* | |
* Depending on the post format, remove the entry header. | |
* | |
* @uses get_post_format() | |
* @see http://codex.wordpress.org/Function_Reference/get_post_format | |
* | |
* @author Ryan Meier <http://www.rfmeier.net> | |
* | |
* @return void | |
*/ | |
function possibly_remove_entry_header() | |
{ | |
//* get the post format | |
$post_format = get_post_format(); | |
//* remove the entry header based on the post format | |
switch( $post_format ) | |
{ | |
//* All possible post formats | |
case 'aside': | |
case 'chat': | |
case 'gallery': | |
case 'link': | |
case 'image': | |
case 'quote': | |
case 'status': | |
case 'video': | |
case 'audio': | |
//* remove the entry header. See Genesis/lib/structure/post.php | |
remove_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 ); | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
break; | |
default: | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment