Skip to content

Instantly share code, notes, and snippets.

@arkadiusjonczek
Created February 23, 2015 15:19
Show Gist options
  • Save arkadiusjonczek/f0c0b56ac4478d528cc5 to your computer and use it in GitHub Desktop.
Save arkadiusjonczek/f0c0b56ac4478d528cc5 to your computer and use it in GitHub Desktop.
WordPress: Show thumbnail in blog posts using Genesis Framework
// insert into functions.php
// please activate featured image in Genesis settings
// show thumbnail in blog post
add_action( 'genesis_entry_header', 'single_post_featured_image', 15 );
function single_post_featured_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 );
}
@braddalton
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment