Last active
August 29, 2015 14:02
-
-
Save rfmeier/d87c2fd0352b428d20a9 to your computer and use it in GitHub Desktop.
Display post format icon only on pages in Genesis.
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 | |
// remove the default Genesis callbacks | |
remove_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 ); | |
remove_action( 'genesis_before_post_title', 'genesis_do_post_format_image' ); | |
add_action( 'genesis_entry_header', 'custom_genesis_do_post_format_image', 4 ); | |
add_action( 'genesis_before_post_title', 'custom_genesis_do_post_format_image' ); | |
/** | |
* Callback for Genesis 'genesis_entry_header' or 'genesis_before_post_title' action. | |
* | |
* If the current post object is a page exit. Else, display the post format icon. | |
* | |
* @author Ryan Meier http://www.rfmeier.net/ | |
* | |
* @return void | |
*/ | |
function custom_genesis_do_post_format_image(){ | |
// if on a page, return | |
if( is_page() ) | |
return; | |
// call the default Gensis post format image function | |
genesis_do_post_format_image(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment