Skip to content

Instantly share code, notes, and snippets.

@ericdebelak
Created August 29, 2016 23:26
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 ericdebelak/5929f4f122edf1392aae4704a347729f to your computer and use it in GitHub Desktop.
Save ericdebelak/5929f4f122edf1392aae4704a347729f to your computer and use it in GitHub Desktop.
Add a banner to secondary pages in Genesis from Featured Image
//* Add secondary page header
add_action('genesis_after_header', 'add_secondary_page_header');
function add_secondary_page_header() {
if(!is_home()) {
if(has_post_thumbnail()) {
echo "<div class='page-header' style='background: url(" . get_the_post_thumbnail_url() . ")'></div>";
} else {
echo "<div class='page-header'></div>";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment