• 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 images showing on both pages and 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 › featured images showing on both pages and posts

This topic is: not resolved

Tagged: aspire pro, featured images

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 7 months ago by radiantaction.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 20, 2017 at 6:06 pm #203514
    radiantaction
    Participant

    Hi All,
    Another question re: Aspire Pro (http://dev.dalenabradley.com)

    When I select featured images to display via the Genesis Theme settings, they show on BOTH the blog archive page AND all other pages.

    How do I get the featured images to display only on the blog archive page but NOT all other pages.

    Thank you again and again!

    Kirsten

    http://dev.dalenabradley.com
    March 20, 2017 at 7:36 pm #203515
    Andykev
    Participant
    // Add featured image above the entry content
    add_action( 'genesis_before_entry', 'legacy_featured_photo' );
    function legacy_featured_photo() {
    
        if ( ! ( is_singular() && has_post_thumbnail() ) ) {
            return;
        }
    
        $image = genesis_get_image( 'format=url&size=single-posts' );
    
        $thumb_id = get_post_thumbnail_id( get_the_ID() );
        $alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );
    
        if ( '' == $alt ) {
            $alt = the_title_attribute( 'echo=0' );
        }
    
        printf( '<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', esc_url( $image ), $alt );
    }

    Comment out this from your functions.php file. It adds a "featured" image to the pages. THIS IS FROM THE LEGACY theme, but it is similar to ASPIRE. So look for similar.

    April 13, 2017 at 2:39 pm #204744
    radiantaction
    Participant

    Finally got to this and it worked perfectly. Thank you for your help!!

    Kirsten

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

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