I use this snippet pretty often building out sites from PSD. Many designers are going with the ol page title in the header look. So this is a simple snippet for how to move genesis entry header markup to the site header.
The first section removes the entry header and markup completely.
Then we add a function to the genesis_header hook that either adds the default markup back to it’s original location or adds it to the bottom of the site header.
Easy as Pie. Let me know if you found this helpful! Thanks!
<?php | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); | |
add_action( 'genesis_header', 'hjs_add_entry_header' ); | |
function hjs_add_entry_header() { | |
if (is_home() || is_front_page() || is_archive()) { | |
add_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); | |
add_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
add_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); | |
} else { ?> | |
<div class="title-banner"> | |
<div class="wrap"> | |
<?php | |
genesis_entry_header_markup_open(); | |
genesis_do_post_title(); | |
genesis_entry_header_markup_close(); | |
?> | |
</div> | |
</div> | |
<?php } | |
} |
Leave a Reply