• 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

Displaying Smaller Version of the Featured Image

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 › Displaying Smaller Version of the Featured Image

This topic is: not resolved

Tagged: featured image, Image Display

  • This topic has 1 reply, 1 voice, and was last updated 8 years, 10 months ago by eluviis.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 4, 2017 at 12:36 pm #200567
    eluviis
    Member

    Hi,

    I usually display the featured image on my posts automatically. This is the code I use:

    /** Custom - Add the featured image section */
    add_action( 'genesis_before_entry_content', 'genesis_featured_image' );
    function genesis_featured_image() {
    	if ( is_singular( array( 'post', 'page', 'specialty', 'event', 'portfolio' ) ) && has_post_thumbnail() ){
    		echo '<div id="featured-image">';
    		echo get_the_post_thumbnail($thumbnail->ID, 'header');
    		echo '</div>';
    	}
    }
    

    Is there a way I can edit that code so it shows one of the smaller versions of my featured image? I upload all my images at 1140px wide and have them resized to 750px, 330px, etc. I'm optimizing my site for speed, so I'm wanting to display that 750px image rather than the full 1140px photo.

    By the way, I was using Magazine Pro, but I'm editing the site for Digital Pro now. Sam applies.

    February 4, 2017 at 3:27 pm #200573
    eluviis
    Member

    I kept searching and searching and came upon some code in the WordPress CODEX and used it to modify the code I had. And it works:

    /** Custom - Add the featured image section */
    add_action( 'genesis_before_entry_content', 'genesis_featured_image' );
    function genesis_featured_image() {
    	if ( is_singular( array( 'post', 'page', 'specialty', 'event', 'portfolio' ) ) && has_post_thumbnail() ){
    		echo '<div id="featured-image">';
    		echo get_the_post_thumbnail($thumbnail->ID, 'medium', array( 'class' => 'aligncenter' ));
    		echo '</div>';
    	}
    }

    Basically, the trick was to replace the ID "header" with the ID "medium". Now it displays my medium image size.

    Interestingly, like with all my post images inside posts, even when you display the medium image, opening the image in a new window or downloading it, yields the full size image. Not sure why it does that. Maybe this is a new feature in WordPress? Or more recent for that matter. Can anyone elaborate?

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