2

I just want to set featured image of my post but don't want to show it in my post. How can I do that?

Detailed : I want to post to show its thumbnail in main page but not to show it when we expend the post ie: Not to show that featured image in post when somebody open that post by clicking Read-More

Plugin will be great.

  • 1
    Please give some more information.. Where do you want to to display, and where don't you. Is this a one-off post where you don't want the image to display, or is it for all posts? – Eric Holmes Dec 26 '13 at 13:34
  • Suggestion about plugin is an off topic here in the community, and I want to add to what @EricHolmes has asked, can you also share your reason behind this, cause if you don't want to show the image, why upload it in the first place or is there anything/anywhere else you want to use the feature image!!! – Maruti Mohanty Dec 26 '13 at 13:50
  • I want to post to show its thumbnail in main page but not to show it when we expend the post ie: Not to show that featured image in post when somebody open that post by clicking Read-More – ShubhamDubey Dec 26 '13 at 13:52
  • @Maruti, Plz read my question again...? – ShubhamDubey Dec 26 '13 at 14:08
1

It sounds like you want the thumbnail on archives but not on single post displays, so if you are willing to edit the theme you can just wrap the thumbnail code in if(!is_single()). For example:

if(!is_single()) {
  the_post_thumbnail();
}

You could also filter post_thumbnail_html but that is pretty wasteful as the the_post_thumbnail does a lot of work before that filter runs.

function no_thumb_on_single($html) {
  if (is_single()) {
    return '';
  } else {
    return $html;
  }
}
add_filter('post_thumbnail_html','no_thumb_on_single');
0

You could use CSS code in your child themes style.css file to hide it:

.single .wp-post-image { 
display: none; 
}

Replace .wp-post-image with the name of your featured image/post thumbnail class your theme uses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.