Title: Parent Categories
Last modified: August 18, 2016

---

# Parent Categories

 *  [spacefall](https://wordpress.org/support/users/spacefall/)
 * (@spacefall)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/parent-categories/)
 * Is there an equivalent of $cat for parent category/categories? I’d like some 
   things to be hidden in specific categories and their children, but I can’t get
   this working in sub-categories at the moment.
    Cheers, SF

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

 *  [skippy](https://wordpress.org/support/users/skippy/)
 * (@skippy)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/parent-categories/#post-64533)
 * You’d need to manually suppress all output from all your “hidden” categories.
   Currently, children categories do not inherit anything from their parent categories,
   so hiding a parent will not hide the children.
 *  Thread Starter [spacefall](https://wordpress.org/support/users/spacefall/)
 * (@spacefall)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/parent-categories/#post-64563)
 * Sorry, I was really unclear in my original post. It’s only menu items in the 
   category list that I’m hiding, so child categories are automatically hidden with
   their parents. That bit’s fine. My problem is in doing this when either the category
   or parent category matches a certain value. Something like, the following, but
   able to detect parent category.
    <?php if ($cat == “3”) { wp_list_cats(‘exclude
   =2’);} else { wp_list_cats;} ?>

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

The topic ‘Parent Categories’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [spacefall](https://wordpress.org/support/users/spacefall/)
 * Last activity: [21 years, 11 months ago](https://wordpress.org/support/topic/parent-categories/#post-64563)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
