• 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

Featured image for Pages

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 › Design Tips and Tricks › Featured image for Pages

This topic is: resolved

Tagged: featured image, pages

  • This topic has 3 replies, 2 voices, and was last updated 9 years, 5 months ago by unklee.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • February 1, 2016 at 3:33 am #178022
    unklee
    Member

    As I understand it, Genesis themes use the featured image to show thumbnails, but not to show the full size image on the Post or Page.

    1. Is there any reason why using the featured image to show on each post and page is a bad idea? Is the best alternative to insert the image manually plus make the same image the featured image?

    2. It is easy to make the featured image show on posts. It requires (1) adding an action in the functions.php file and (2) specifying the size the featured image should be if necessary. (1) requires the following code:

    add_action( 'genesis_before_entry_content', 'featured_post_image', 8 );
    function featured_post_image() {
      if ( ! is_singular( 'post' ) )  return;
    	the_post_thumbnail('post-image');
    }

    I have been able to do this successfully. As far as I can see, I should be able to do the same thing for adding the featured image to the top of pages, by changing the third line of code to say "page" - either by having a separate section of code, or by using an "or" function. But I don't seem to be able to make it work

    Is there something else I need to do to make the featured image work on pages please?

    February 1, 2016 at 6:27 am #178036
    manavecplan
    Member

    Does this work for you? Presuming that you wanted to target both pages and posts...

    function featured_post_image() {
      if ( !is_singular( array( 'post', 'page' ) ))  return;
        the_post_thumbnail('post-image'); //you can use medium, large or a custom size
    }
    add_action( 'genesis_before_entry', 'featured_post_image', 1 );
    
    
    February 1, 2016 at 6:46 am #178040
    unklee
    Member

    Hi, thanks, that seems to have nailed it! I tried something very similar to this that didn't work, but I must have got something wrong. Thanks a lot.

    February 2, 2016 at 3:20 am #178129
    unklee
    Member

    Hi, I don't know if you're still following this thread, but I am curious. It seems (unless I have missed something, which is always possible) that there were only three differences in your code from what I tried but couldn't get to work, and I'm curious as to the difference.

    1. You had 'genesis_before_entry' whereas I had 'genesis_before_entry_content'. This determines whether the image is before the heading or afterwards, and works either way.

    2. You had the add_action line after the function, whereas I had it first. I don't think this makes any difference, does it?

    3. In the add_action, you had the priority as 1, whereas I had 8. This means the function is executed earlier (than what?) - would this make a difference?

    Just curious to learn a little more. Thanks.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ 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