Created
February 23, 2015 15:19
-
-
Save arkadiusjonczek/f0c0b56ac4478d528cc5 to your computer and use it in GitHub Desktop.
WordPress: Show thumbnail in blog posts using Genesis Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll find more code like this on the authors website https://wpsites.net/web-design/display-featured-image-before-or-after-entry-title-on-single-posts-pages/