Title: Exclude Cats
Last modified: August 18, 2016

---

# Exclude Cats

 *  [phunk](https://wordpress.org/support/users/phunk/)
 * (@phunk)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/exclude-cats/)
 * Im wanting to be able to hide certain cats depending on which page your view 
   my site on whats the best way to do this?

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

 *  [Jack](https://wordpress.org/support/users/moxie/)
 * (@moxie)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/exclude-cats/#post-151737)
 * I’m not an expert on this, but if you’re already using seperate pages for the
   content it would be sufficient to change the wp_list_cats(“exclude-thingy… in
   each page. Otherwise you could insert a couple of if()’s before calling the wp_list_cat
   function, where you check which page has been called.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/exclude-cats/#post-151739)
 * moxie’s suggestion of having separate page templates for each page would work,
   though may be a problem to manage if we’re talking about a lot.
 * A PHP if/else statement *could* perform this for you. Here’s an (inoperable) 
   example:
 * `<?php if(THIS_PAGE) {
    wp_list_cats('exclude=1'); } elseif (THIS_PAGE) { wp_list_cats('
   exclude=2'); } elseif (THIS_PAGE) { wp_list_cats('exclude=3'); } else { wp_list_cats();}?
   >
 * What THIS_PAGE is filling in for pretty much depends on what you mean by “depending
   on which page your view my site”.

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

The topic ‘Exclude Cats’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [21 years, 2 months ago](https://wordpress.org/support/topic/exclude-cats/#post-151739)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
