• 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)
  • 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

    (@spacefall)

    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.