Title: Disabling thumbnails from certain categories
Last modified: August 19, 2016

---

# Disabling thumbnails from certain categories

 *  [fabiovasques](https://wordpress.org/support/users/fabiovasques/)
 * (@fabiovasques)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/)
 * Hello,
 * In my blog the thumbnail feature is enabled. However, I would like that this 
   feature was enabled only to certain categories. Eg.: I have two categories, in
   which the posts associate to them go to the home page – to these categories I
   want the thumbnails enabled. However, I have other posts associate to other categories,
   which don’t go the home page – to posts from these categories, I would like do
   disable the thumbnail feature. Is this possible?
 * Thanks in advance,
    Fábio Vasques

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/#post-1589470)
 * You can’t disable post thumbnails on a per-category basis but you could stop 
   any post thumbnails from being displayed for certain categories using the `is_category`
   [conditional](http://codex.wordpress.org/Conditional_Tags).
 *  Thread Starter [fabiovasques](https://wordpress.org/support/users/fabiovasques/)
 * (@fabiovasques)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/#post-1589630)
 * Hi,
 * Thanks for your quick response!
    Could you please be more specific? I’m not very
   familiar with PHP…just know how to change the basic…
 * Thanks again!
    Fábio
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/#post-1589668)
 *     ```
       <?php
       // don't show thumbnail for categories 3, 7 & 9
       if( !is_category( array(3,7,'9') ) ) the_post_thumbnail();
       ?>
       ```
   
 *  Thread Starter [fabiovasques](https://wordpress.org/support/users/fabiovasques/)
 * (@fabiovasques)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/#post-1589702)
 * Thanks for the code! I understood that I have to adapt it to my categories. In
   your example, the last category (9) is between ”, right?
    Only one last help:
   in which file do I insert it?
 * I tried in a few files, but didn’t work. Eg.: When I’ve inserted the code in 
   the “post-thumb.php” file, didn’t work to the selected categories (thumbnails
   were still showing) and in the non-selected categories the thumbnail got bigger.
 * Thanks again for your help and your patience!
    Fábio
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/#post-1589754)
 * Typo. It should have read:
 *     ```
       <?php
       // don't show thumbnail for categories 3, 7 & 9
       if( !is_category( array(3,7,9) ) ) the_post_thumbnail();
       ?>
       ```
   
 * No single quotes.
 *  Thread Starter [fabiovasques](https://wordpress.org/support/users/fabiovasques/)
 * (@fabiovasques)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/#post-1589758)
 * Thanks! In which file should I insert this code?
 * Thanks in advance
    Fábio
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/#post-1589760)
 * In your theme’s category template file. Either category.php. archive.php or index.
   php – depending upon the theme.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Disabling thumbnails from certain categories’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [thumnails](https://wordpress.org/support/topic-tag/thumnails/)

 * 7 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/disabling-thumbnails-from-certain-categories/#post-1589760)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
