Created
August 29, 2016 23:26
-
-
Save ericdebelak/5929f4f122edf1392aae4704a347729f to your computer and use it in GitHub Desktop.
Add a banner to secondary pages in Genesis from Featured Image
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
//* 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