Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 15, 2015 00:39
Show Gist options
  • Save braddalton/5174955 to your computer and use it in GitHub Desktop.
Save braddalton/5174955 to your computer and use it in GitHub Desktop.
Display featured image after title but before content on single posts. Change the genesis_hook to your own theme specific hook if needed. You can also change the conditional tag if needed.
add_action( 'genesis_after_post_title', 'wpsites_after_post_title_featured_image' );
function wpsites_after_post_title_featured_image() {
if ( is_single() ) return;
if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
printf( '<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment