Support › Forums › Flex Theme › Featured image isn’t showing on individual blog posts › Reply To: Featured image isn’t showing on individual blog posts
August 3, 2016 at 6:32 am
#1153
Moderator
Extremely Sorry! Above code is wrong. Here is the correct one:
add_action('genesis_entry_header', 'flex_single_post_image', 4 );
function flex_single_post_image() {
if( ! is_singular( 'post' ) )
return;
$img = genesis_get_image( array(
'format' => 'html',
'size' => 'large',
'context' => 'archive',
'attr' => genesis_parse_attr( 'entry-image', array ( 'alt' => get_the_title() ) ),
) );
if ( ! empty( $img ) ) {
echo $img;
}
}
-
This reply was modified 6 years ago by
Chinmoy Paul.