Skip to content

Instantly share code, notes, and snippets.

@michaelcarwile
Last active August 29, 2015 13:59
Show Gist options
  • Save michaelcarwile/10923908 to your computer and use it in GitHub Desktop.
Save michaelcarwile/10923908 to your computer and use it in GitHub Desktop.
Featured image check if featured image exists and place on theme for WordPress Genesis child theme.
<?php
//* don't copy opening php tag above
//* Add featured image to top of posts
add_action('genesis_before_entry', 'featured_post_image', 8);
function featured_post_image() {
if (has_post_thumbnail()) : ?>
<div class="featured-image">
<?php the_post_thumbnail('post-image'); ?>
</div>
<?php endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment