Skip to content

Instantly share code, notes, and snippets.

@nickdavis
Created March 7, 2016 13:11
Show Gist options
  • Save nickdavis/54ed662714ce9fe9231b to your computer and use it in GitHub Desktop.
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
<?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