- This topic has 2 replies, 2 voices, and was last updated 6 years, 2 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Community Forums › Skope Theme Support › Display Featured Image on top of the post/page
Hi! Is there a way to display Featured Image on top of the post/page?
I usually use this code, but it’s not working with this theme:
function featured_post_image() {
if ( !is_singular( array( 'post', 'page' ) )) return;
the_post_thumbnail('800,500'); //you can use medium, large or a custom size
}
add_action( 'genesis_before_entry', 'featured_post_image', 1 );
I don’t have this theme so I’m not sure if this will work or not, but here’s the code I use (copied from another thread/theme) –
//* Add featured image above the entry content
add_action( 'genesis_entry_header', 'aspire_featured_photo', 5 );
function aspire_featured_photo() {
if ( is_attachment() || ! genesis_get_option( 'content_archive_thumbnail' ) )
return;
if ( is_singular() && $image = genesis_get_image( array( 'format' => 'url', 'size' => genesis_get_option( 'image_size' ) ) ) ) {
printf( '<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', $image, the_title_attribute( 'echo=0' ) );
}
}
If needed, you could replace the aspire
with skope
in the function. May or may not be necessary though.
I’ve tried both versions – skope and aspire – but, unfortunately, it’s not working ๐
Any other suggestions?