Created
February 8, 2014 23:58
-
-
Save rfmeier/8892188 to your computer and use it in GitHub Desktop.
If on a single post or page, remove the default page or post title, then place it within the 'genesis_header' section.
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 | |
add_action( 'genesis_header', 'sample_genesis_header' ); | |
/** | |
* Callback for Genesis 'genesis_header' action. | |
* | |
* If on a single post or page, display the post or page title within the header area. | |
* | |
* @return None | |
*/ | |
function sample_genesis_header(){ | |
// if not single page or post, return | |
if( ! is_singular() ) | |
return; | |
// display the post title | |
genesis_do_post_title(); | |
} | |
add_action( 'genesis_before_entry', 'sample_genesis_before_entry' ); | |
/** | |
* Callback for Genesis 'genesis_before_entry' action. | |
* | |
* If on a single post or page, remove the default Genesis post or page title. | |
* | |
* @return None | |
*/ | |
function sample_genesis_before_entry(){ | |
// if not single page or post, return | |
if( ! is_singular() ) | |
return; | |
// remove all default header hooks | |
remove_all_actions( 'genesis_entry_header' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment