Support » Themes and Templates » Excluding a category using WP_LIST_CATEGORIES

  • Hi guys,

    I’m trying to exclude a top level category from a cat nav bar.

    I’ve tried using ‘include’ and ‘exclude’, I’ve tried moving the placement of both arguments (is that what they’re called? Newb), I’ve tried changing the depth etc and NOTHING is having any effect on the actual site.

    Is there something that would be overriding my header file?

    The specific situation is this: The category in question was once a child category of a different top level category, and I made it a top level category today. Now it won’t disappear, although it was happily hidden when it was a child category. This makes me wonder if it is a matter of how I’m calling the menu.

    Here is the code as it is now:

    wp_list_categories('include=1603,3,1678,84,488,7&sort_column=name&title_li=&depth=3'); ?>

    Here is the code as it was:

    wp_list_categories('sort_column=name&title_li=&depth=3&exclude=1527,1532'); ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • Chip Bennett


    Theme Review Admin

    What is the ID of the category you want to exclude?

    Both 1527 and 1532, though 1532 is the new one that is, for some reason, not working. 1527 excludes just fine.

    Chip Bennett


    Theme Review Admin

    Does category ID 1532 have child categories?

    If so, try using &exclude_tree=1532 instead.

    No, it’s just a one level category that I use to show thumbnails on the frontpage via metadata.

    Not sure if this information is of use, but the problem only seems to occur on the home page. When looking at the various category pages (I guess they’re category archives?), the nav bar looks fine.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Excluding a category using WP_LIST_CATEGORIES’ is closed to new replies.