• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Eleven40 Pro: Show featured image – How to

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Eleven40 Pro: Show featured image – How to

This topic is: not resolved
  • This topic has 8 replies, 5 voices, and was last updated 11 years, 3 months ago by guitardaddy180.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • December 24, 2013 at 10:23 am #81074
    mmjaeger
    Member

    Hello

    How can I show the featured image on the single-post page using the Eleven40 Pro theme.

    Thank you in advance for your help.

    December 24, 2013 at 10:48 am #81078
    Genesis Developer
    Member

    Try to add this code in functions.php file

    add_action( 'genesis_entry_content', 'genesis_do_single_post_image', 8 );
    add_action( 'genesis_post_content', 'genesis_do_single_post_image' );
    function genesis_do_single_post_image() {
    
    	if ( is_single() ) {
    		$img = genesis_get_image( array(
    			'format'  => 'html',
    			'size'    => genesis_get_option( 'image_size' ),
    			'context' => 'archive',
    			'attr'    => genesis_parse_attr( 'entry-image' ),
    		) );
    
    		if ( ! empty( $img ) )
    			printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img );
    	}
    
    }
    

    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    January 9, 2014 at 3:15 pm #84250
    corbinl
    Member

    @genwrock,

    Thanks for this -- it displayed for me! But now, it's left-aligned for all entries, which sometimes pushes the text all over.

    Is there an easy way to top-align it, so the singlepost featured image is above the title, such as with Streamline and some other themes? Thanks for your help.

    --
    Best regards,
    Corbin

    January 9, 2014 at 9:42 pm #84299
    Genesis Developer
    Member

    Ok. Then remove this two lines

    add_action( 'genesis_entry_content', 'genesis_do_single_post_image', 8 );
    add_action( 'genesis_post_content', 'genesis_do_single_post_image' );

    And add this two lines

    add_action( 'genesis_entry_header', 'genesis_do_single_post_image' ); // this is for HTML5 hook
    add_action( 'genesis_before_post_title', 'genesis_do_single_post_image' ); // Thi sis for Pre-HTML5 hook

    also you want a full width image then change this line 'size' => genesis_get_option( 'image_size' ), to 'size' => 'full',


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    January 10, 2014 at 5:05 am #84342
    corbinl
    Member

    Perfect! Thanks @genwrock for all your help!

    January 30, 2014 at 10:39 am #87835
    jlph
    Participant

    Is there something I can add to this code to have the featured image appear in the posts on the homepage as well, instead of just the archive?

    March 2, 2014 at 11:50 am #93074
    guitardaddy180
    Member

    How do we align the image to the right hand side then?

    Thanks for your response!

    March 2, 2014 at 12:01 pm #93076
    Genesis Developer
    Member

    @guitardaddy180

    Try this code once

    function featured_image_right_alignment( $attributes ) {
            $attributes['class'] = str_replace( 'alignleft', 'alignright', $attributes['class'] );
            return $attributes;
    }
    add_filter( 'genesis_attr_entry-image', 'featured_image_right_alignment' );

    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    March 2, 2014 at 1:10 pm #93084
    guitardaddy180
    Member

    genrock! Thank You again!!!!!

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble