• 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

Only show feature image and not image in content

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 › Only show feature image and not image in content

This topic is: not resolved

Tagged: feature image

  • This topic has 2 replies, 1 voice, and was last updated 13 years, 4 months ago by Treefungus.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 14, 2013 at 11:23 am #11851
    Treefungus
    Member

    Hi

    I have successfully managed to put my image before content on this site http://bestapp.tv/test-test-test/

    by using this code

    /** Add custom field above page */
    add_action( 'genesis_before_content', 'littledevil_page_image' );
    function littledevil_page_image() {
    if ( $image = genesis_get_image( 'format=url&size=post-photo' ) ) {
    printf( '<a href="%s" rel="bookmark"><img class="page-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
    }

    }

    but I want it to only be the feature image and if I do not set a feature image then no image should be put in that area.

    Is this possible? Or will it always fall back on the content image if no feature image is set?

    January 14, 2013 at 12:03 pm #11865
    Treefungus
    Member

    Ok I have tried something new which is this code. I am now only picking up post_thumbnail

    /** Add custom field above page */
    add_action( 'genesis_before_content', 'littledevil_page_image' );
    function littledevil_page_image() {
    if ( has_post_thumbnail() )
    the_post_thumbnail( 'full' );
    echo '<div class="imgfeatured">';
    echo '</div>';

    }

    but my styling is not working. I cannot seem to remove my styling that I have made to normal images using img class. I want this specific image to have the imgfeatured style.

    Any help is appreciated.

    Thanks

    January 14, 2013 at 12:44 pm #11879
    Treefungus
    Member

    Also tried this but still cannot give it my own div class

    /** Add custom field above page */
    add_action( 'genesis_before_content', 'littledevil_page_image' );
    function littledevil_page_image() {
    if ( has_post_thumbnail() ){
    echo '<div class="imgfeatured">';
    echo the_post_thumbnail( 'full' );
    echo '</div><!-- end .imgfeatured -->';
    }
    }

  • 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

© 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