• 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

Add Featured Image to Posts on Sixteen Nine Pro

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 › Add Featured Image to Posts on Sixteen Nine Pro

This topic is: not resolved
  • This topic has 10 replies, 2 voices, and was last updated 12 years, 5 months ago by Marcy.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • August 8, 2013 at 9:39 am #54935
    scottwyden
    Member

    My brain might be fried but I can't for the life of me figure out how to get the featured image to show at the top of a post on a site using Sixteen Nine Pro.

    Any advice is appreciated!

    http://phototickr.com
    August 8, 2013 at 6:34 pm #55146
    Marcy
    Participant

    That should be Genesis 2.0 using html5. I modified the code in the link below for html5 and is_single().
    Please let me know if it works for you.

    // Add Post image above post title, single posts only
    add_action( 'genesis_entry_content', 'agency_post_image', 8 );
    function agency_post_image() {
    if (( is_single() ) && ( $image = genesis_get_image( 'format=url&size=post-image' ) )) {
    printf( '%s', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
    }
    }
    // See more at: http://kevinshoffner.com/wordpress/tricks/featured-images-in-any-genesis-theme/


    Marcy | Amethyst Website Design | Twitter

    August 9, 2013 at 11:21 am #55271
    scottwyden
    Member

    I appreciate the reply - the code didn't post correctly though. An image showed up.

    August 9, 2013 at 11:28 am #55272
    Marcy
    Participant

    Did I misunderstand? I thought you wanted an image to show up.


    Marcy | Amethyst Website Design | Twitter

    August 9, 2013 at 11:29 am #55273
    scottwyden
    Member

    I do, but please look at the code you pasted above. It's showing a broken image rather then part of the code.

    August 9, 2013 at 11:46 am #55278
    Marcy
    Participant

    I don't see a broken image in the code, but it could be because the quote marks didn't paste correctly. I also can't seem to edit the post, so here it is again. I hope I got all the quotes. Is this what you wanted?

    add_action( 'genesis_entry_content', 'agency_post_image', 8 );
    function agency_post_image() {
    if (( is_single() ) && ( $image = genesis_get_image( 'format=url&size=post-image' ) )) {
    printf( '%s', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
    }
    }
    

    Marcy | Amethyst Website Design | Twitter

    August 9, 2013 at 11:46 am #55279
    scottwyden
    Member

    Oh that's odd. This is what i'm seeing: https://www.monosnap.com/image/Dqog6d9uUTdh8LXnVWMa9Ljyf

    The new is there now, but unfortunately doesn't work. It just pastes a link at the top of posts.

    August 9, 2013 at 12:07 pm #55285
    Marcy
    Participant

    I'm sorry it's not working for you; it works for me. Maybe you can go to the link and get the orignal code?

    Here are some more posts to help with images.


    http://surefirewebservices.com/development/genesis-framework/using-the-genesis-featured-image

    Genesis Explained Image Functions

    The first link is nearly exactly the code I pasted above, except that there is a 5 instead of an 8, which would make it load earlier, so try that. Otherwise I don't know what to tell you.


    Marcy | Amethyst Website Design | Twitter

    August 9, 2013 at 12:49 pm #55295
    Marcy
    Participant

    I'm sorry, I can't get this code to work on the Sixteen Nine Pro theme either.
    Make a new post and ask the question again, so someone else will see it's not answered.


    Marcy | Amethyst Website Design | Twitter

    August 10, 2013 at 3:40 pm #55536
    Marcy
    Participant

    OK. Here it is. This one works on Sixteen Nine Pro. Sorry for the confusion at first. Hope it helps!

    add_action( 'genesis_before_entry_content', 'amethyst_add_feature_image' );
    function amethyst_add_feature_image() {
        if ( (is_singular( 'post' )) && (has_post_thumbnail()) ) {
        genesis_image(
            array(
                'size' => 'amethyst-post-image-size',
                'attr' => array('class' => 'aligncenter')
        ) );
    }
    }
    

    Edit: When pasting code into a code block, in some browsers the underscores disappear, so be sure to copy and paste the code.


    Marcy | Amethyst Website Design | Twitter

    August 11, 2013 at 1:29 am #55593
    Marcy
    Participant

    The code didn't paste correctly.

    add_action( 'genesis_before_entry_content', 'custom_add_feature_image' );
    function custom_add_feature_image() {
        if (  (is_singular( 'post' ) ) && ( has_post_thumbnail() ) ) {
    		genesis_image(
    			array(
    				'size' => 'large',
    				'attr' => array('class' => 'aligncenter')
    		) );
    	}
    }

    You want to use 'large' or 'medium' for the 'size' as well.

    Edit: Fixing the 2 ampersands that aren't pasting correctly
    The code should have && rather than code in the if portion of the code


    Marcy | Amethyst Website Design | Twitter

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 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

© 2026 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