• 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

Hide featured image on posts

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 › Hide featured image on posts

This topic is: not resolved

Tagged: featured image, minimum

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 11 months ago by TravisPri.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 4, 2013 at 10:55 am #60662
    wyattwerner
    Member

    I'm using the Minimum theme, and I'd like to hide the featured image on particular posts. I assigned the post a body class (consumer-confusion) and tried to hide it with css using:

    .consumer-confusion #featured-image {
    	display: none !important;
    }

    No dice, though. I can control other styles on the page like "p", but not #featured-image or even img.

    I tried using the post id, too (post-2), but no avail. Again, I could control other styles, but not the featured image.

    Any advice?

    (the site is still in dev, so no URL; sorry)

    September 4, 2013 at 3:39 pm #60715
    TravisPri
    Member

    I think this would be a php issue.

    The featured image section is coded in functions.php; look for "Add the featured image section." The code below should be in your existing theme and is what needs to be edited.

    Before editing functions.php, make sure you have a copy of the file saved before making changes, and make sure you have ftp access to the site in case something goes wrong.

    /** Add the featured image section */
    add_action( 'genesis_after_header', 'minimum_featured_image' );
    function minimum_featured_image() {
    	if ( is_home() ) {
    		echo '<div id="featured-image"><img src="'. get_stylesheet_directory_uri() . '/images/sample.jpg" /></div>';
    	}
    	elseif ( is_singular( array( 'post', 'page' ) ) && has_post_thumbnail() ){
    		echo '<div id="featured-image">';
    		echo get_the_post_thumbnail($thumbnail->ID, 'header');
    		echo '</div>';
    	}
    }

    I wanted to make it so there was no featured image on any posts, so my code looks like this:

    /** Add the featured image section */
    add_action( 'genesis_after_header', 'minimum_featured_image' );
    function minimum_featured_image() {
    	if ( is_home() ) {
    		echo '<div id="featured-image"><img src="'. get_stylesheet_directory_uri() . '/images/sample.jpg" /></div>';
    	}
    	elseif ( is_singular( array( 'page' ) ) && has_post_thumbnail() ){
    		echo '<div id="featured-image">';
    		echo get_the_post_thumbnail($thumbnail->ID, 'header');
    		echo '</div>';
    	}
    }

    In order to hide the featured image on specific posts, you will need to target them in the php. I'm no php master and I don't want to mess up your site.. I haven't tried this on mine. Again, make sure you have a copy of your code and ftp access in case this breaks something and you have to put the original code back in.

    I THINK the code would look like this [replace Post Titles in the last function with the titles of the posts you want to hide featured images on]:

    /** Add the featured image section */
    add_action( 'genesis_after_header', 'minimum_featured_image' );
    function minimum_featured_image() {
    	if ( is_home() ) {
    		echo '<div id="featured-image"><img src="'. get_stylesheet_directory_uri() . '/images/sample.jpg" /></div>';
    	}
    	elseif ( is_singular( array( 'post', 'page' ) ) && has_post_thumbnail() ){
    		echo '<div id="featured-image">';
    		echo get_the_post_thumbnail($thumbnail->ID, 'header');
    		echo '</div>';
    	}
           elseif ( is_single( array ( 'Post Title', 'Post Title 2', 'Post Title 3 ' ) ) ){
            }
    }

    For your reference: http://codex.wordpress.org/Function_Reference/is_single

    Hope this helps!

  • 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

© 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