• I have a site I’m building with 5 top level categories, each of these categories has a number of sub-categories. I want the category list just to show the 5 top level categories only and not list the sub categories and I’m stuck on what tag to use….any help much appreciated 🙂

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • I used your post title and a Google search on site:wordpress.org and came up with this list of threads you may find helpful:
    http://tinyurl.com/6bh7w

    Thread Starter urbanmac

    (@urbanmac)

    Thanks for the link (I never knew you could do that in google!)

    I’ve read through a number of postings and I still cant find what I’m after.

    Locate the wp_list_cats command in your “index.php” file (or whichever file shows the thing – in v1.5 it’ll be in the “sidebar.php” file instead) and add the command children=0 to it.

    For example, it might look like this:
    <?php wp_list_cats('children=0'); ?>

    That’ll show only the main categories.

    Thread Starter urbanmac

    (@urbanmac)

    I’ll give it ago – Thank you 🙂

    Thread Starter urbanmac

    (@urbanmac)

    Thats not working for me – its still showing the sub catagories but has moved them to the same level in the bulleted list

    before:
    * cat 1
    * cat 2
       * sub cat
    *cat 3

    after:
    * cat 1
    * cat 2
    * sub cat
    *cat 3

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show Top Level Categories Only’ is closed to new replies.