Created
December 4, 2013 21:45
-
-
Save JiveDig/7796157 to your computer and use it in GitHub Desktop.
Show featured image (post thumbnail) on single posts
This file contains hidden or 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
<?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