Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Created December 4, 2013 21:45
Show Gist options
  • Save JiveDig/7796157 to your computer and use it in GitHub Desktop.
Save JiveDig/7796157 to your computer and use it in GitHub Desktop.
Show featured image (post thumbnail) on single posts
<?php
// Show featured image on single posts
add_action( 'genesis_before_entry_content', 'child_featured_post_image', 8 );
function child_featured_post_image() {
if ( ! is_singular( 'post' ) ) return;
the_post_thumbnail('post-image');
}
// OR THIS ONE
// Show featured image on single posts
add_action( 'genesis_before_entry_content', 'child_featured_post_image', 8 );
function child_featured_post_image() {
if ( ! is_singular( 'post' ) )
return;
$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) );
printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment