WordPress.org

Ready to get started?Download WordPress

Forums

Two sets of categories using exclude (3 posts)

  1. emarketing
    Member
    Posted 8 years ago #

    I'm using WP1.5.2 and I am trying to split my categories into two separate sections in the sidebar ie. categories 1-10 under one heading and categories 11-20 under a second. I want to avoid using subcategories because I use the category name in the permalink and this would therefore impact it.

    I thought that I could do this just using the normal <?php list_cats(); ?> and then use the exclude function to "hide" the categories I didn't want to show. This works fine for the 1st section (ie. hides 11-20) but then the second section seems to hide both groups, although only 1-10 are specified in the exclude.

    Am I missing something or do I need to add anything else in the code to "regenerate" the full category list before then excluding the 2nd set of categories?

    TIA

  2. emarketing
    Member
    Posted 8 years ago #

    Don't know if it's significant, but I notice that if I put <?php list_cats(); ?> without excludes ahead of the others that contain the excludes, then the correct categories do show as I would have hoped in the other places.

    Unfortunately, of course, I then have a new list of all the categories which I don't want to show. :(

  3. emarketing
    Member
    Posted 8 years ago #

    Any thoughts or pointers?

Topic Closed

This topic has been closed to new replies.

About this Topic