Created
March 7, 2016 13:11
-
-
Save nickdavis/54ed662714ce9fe9231b to your computer and use it in GitHub Desktop.
Add a featured image automatically to the top of single posts on the Kickstart Pro theme
This file contains hidden or 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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
add_action( 'genesis_entry_content', 'kickstart_post_featured_image', 9 ); | |
/** | |
* Display Featured Image automatically at top of post (single view) | |
* | |
*/ | |
function kickstart_post_featured_image() { | |
// If we're not viewing a post get out of here | |
if ( ! is_singular( array( 'post' ) ) ) { | |
return; | |
} | |
// Only show a featured image if one is set | |
if ( has_post_thumbnail() ) { | |
echo '<p>' . genesis_get_image() . '</p>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment