Only Show Featured Images for Posts with Set Featured Images

Community Forums Forums Design Tips and Tricks Only Show Featured Images for Posts with Set Featured Images

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  nunotmp 11 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #61439

    brobinson
    Participant

    I was wondering if there was a way to only show the featured images for posts where the feature image has been set. I know Genesis pulls the first image in a post for the feature if no feature is set and I want to prevent this from happening. Is it possible to do this?

    http://www.cuisineous.com
    #61448

    nunotmp
    Participant
    Post count: 164

    Assuming you are using genesis 2.0+ You can first remove it with
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );

    Then we register it with like so

    if ( has_post_thumbnail() ) { 
    add_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); 
    }

    This will call the genesis_do_image() function only if the post has a thumbnail.


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.