• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Appfinite

Appfinite

Premium WordPress Themes for The Genesis Framework

  • Themes
  • Blog
  • Tutorials and Resources
  • Forums
  • Contact Us

Display Featured Image on top of the post/page

Home › Community Forums › Skope Theme Support › Display Featured Image on top of the post/page

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 2 months ago by informativka.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • November 13, 2016 at 10:38 am #19956
    informativka
    Customer

    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 );
    November 15, 2016 at 12:32 am #19971
    Jessy
    Customer

    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.

    November 15, 2016 at 4:08 am #19974
    informativka
    Customer

    I’ve tried both versions – skope and aspire – but, unfortunately, it’s not working ๐Ÿ™

    Any other suggestions?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Primary Sidebar

Search Forums

Affiliate Program

Looking to earn some money? Join our Affiliate program and earn 35% of every sale you refer. Top referrers earn 40-50%.

Join Now โ†’

The Genesis Framework

All of our themes are designed for the Genesis Framework. You will need to purchase Genesis in order to use any of our themes.

Purchase Genesis

Hire a Web Developer

Need help setting up or customizing your website?

Contact Us โ†’

Search Full Site

  • Buy Genesis!
  • Shopping Cart
  • Themes
  • My Account
  • Support Forums
  • Tutorials and Resources
  • Privacy Policy
  • Contact Us
  • Follow Us on Twitter

Copyright © 2023 ยท Appfinite ยท Built With The Genesis Framework