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.

2 Answers
2

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');

Leave a Reply

Your email address will not be published. Required fields are marked *