You can use in_cateogry function to check if the current post is in your special category. And if it is, you can then display the featured image. Something like:
if( in_category( 'YOUR CATEGORY ID OR SLUG', get_the_ID() ) ){
the_post_thumbnail();
}
Obviously replace ‘YOUR CATEGORY ID OR SLUG’ with proper value.
Related Posts:
- Limit function to specific post category
- Get attachments for posts that belongs to a specific category
- List all categories with featured image from post?
- Change the background of each post according to the category
- How to show category image if no featured image is set?
- Get Posts Under Custom Taxonomy
- How to display related posts from same category?
- removing inline styles from wp-caption div
- Add custom Attachment Display Setting for images
- How to show related posts by category
- How to add category to: ‘wp-admin/post-new.php’?
- Including categories in search results
- Use category base slug in posts’ permalink
- Different post sort order within different categories
- Count how many posts in category
- Custom Single Post By Category
- Setting Custom Sort Order of Posts within a Category
- How to get the number of posts in a selected category?
- MySQL Query to Retrieve Category from wp_posts
- Different number of posts in each category
- How to get Images included in Post
- disable WP automatically inserted line breaks after an image
- Display all posts from specific categories on a page
- Find the post an attachment is attached to
- Display the latest post from a category in a page
- Delete the original big size image after upload and leave only 3 images crunched by media gallery
- Post slugs and images cannot have same name?
- Add existing images from Media Library in to custom gallery
- How to show list of posts by author and category?
- Replace image attributes for lazyload plugin (data-src)
- How do I detach images from posts?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Category checkbox list tree changes when editing a post
- How to add metabox for post of specific category
- Convert custom fields to post categories
- Manipulate post category after time
- Show related posts by category but ignore one category
- How to sort posts by last name (2nd word) on ONE category only?
- How to disable Uncategorized category URL?
- Add role that restricts user to post in specific category
- How to get Category Id from Post Id ?
- Download external images if post is publish
- Count posts in category including child categories
- Query posts from current year
- Getting Position of a post in a category
- How do I sort (order) the results from `get_children()`?
- Display only posts from a specific parent category
- How to control which category will be picked for the slug of a post?
- upload image in a meta box
- Categories box not showing on post edit pages
- Can I load posts via Ajax?
- How do I use element instead of tags in WordPress post content having webP support?
- get_the_term_list by hierarchy order
- How to change the layout and styling of posts according to their category in WordPress?
- How to remove images from showing in a post with the_content()?
- List only child categories a post is in, of a specific parent category
- Add default content to post (for specific category)
- Unattaching images from a post
- how to display post content without post image?
- Query only Posts from Both of Two Category?
- Show Custom Taxonomy Categories, Listing of Posts, and Single Post via AJAX
- How to wrap every image in a post with a div?
- upload featured image from front end using wordpress add media button
- Add custom field to all posts in specific category
- Exclude category on blog list page
- display sub categories assoccited with each post in a category archive page
- is there a better way of combining this?
- Display most recent post in category instead of archive?
- How do I create Comma Separated list of attached image ids?
- How can I specify a category post on my home page
- Single.php Active Category Class
- Most efficient way to list all categories and display a post for each of them?
- Archived Posts in Wrong Category
- Get post embedded image caption
- Show One Category on Post
- how to grab first link in post… and of course call it
- Use template of parent category for single post sub-categories
- prevent showing posts of an specific category in admin posts section
- How to choose a sort order (for posts) per category? (ideally when creating a new category)
- Load post content into div with ajax
- wp_list_categories link to first post of category instead of calling taxonomy template
- How to search only by post title and category?
- Add custom field to category of custom post type
- WordPress Child Category Display All Posts
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- get_post_type_archive_link(‘post’) returns current category archive
- Display all posts under child sub category in sidebar on post page?
- Add an image box besides featured image?
- Remove image from post also removes photo from media library
- Do I use custom post type or something else?
- Can I hide a specific post from latest posts page?
- How do I get the slug of a custom taxonomy category of a post?
- What Defines What Category A Post Picks (if in multiple)
- Featured Posts for Category Pages
- Auto set Post to Specific Categories
- Permalink Settings: optional settings doesn’t apply to editor
- How to show post(excerpt) from specific category on wp page?
- How to Add ‘Post Categories’ to the Dashboard Sidebar
- New blog template to display only one category
- Authors in menu, template list post by author