Is there any plugin or alternative method to hide featured images of all the posts falling under the same category? Please guide.
For example:
There's a website category:
abc/category/fruits Under this category the following posts are published Apple, Mango, Cherry, Orange
All the posts under fruits category have featured images, I want featured images of posts not to appear when someone visits this "category link". Please note that on my homepage I want the images to appear but not in category link.
Is there any plugin or alternative method to hide featured images of all the posts falling under the same category? Please guide.
For example:
There's a website category:
abc.net/category/fruits Under this category the following posts are published Apple, Mango, Cherry, Orange
All the posts under fruits category have featured images, I want featured images of posts not to appear when someone visits this "category link". Please note that on my homepage I want the images to appear but not in category link.
Share Improve this question asked Feb 3, 2022 at 6:53 MS09MS09 12 Answers
Reset to default 0You can use a different theme, or create your own child theme where you override the category template, but since every theme is coded differently, it's unlikely a plugin would be able to disable featured images on categories for every theme out there.
You could use css to hide the featured image for the specific catgeory
Eg:
.category-fruits .featured-image img {
display: none;
}
Use this post as a guide for various methods on how to target the specific category pages
https://www.wpbeginner.com/wp-themes/how-to-style-individual-categories-differently-in-wordpress/
Using PHP, find the code for displaying the featured image on single.php, and use an if statement to only display the image if it is not in category fruit, something like:
if( !has_category('fruit') ) { // put code for featured image here }