WordPress.org

Support

Support » How-To and Troubleshooting » Omission of a category

Omission of a category

  • I was wondering if it were possible to omit a certain category, while allowing all the other categories to be displayed normally. I have the intention of displaying this category on its own on the right of the page, and all the other categories on the left. I think I’ve worked out a way to display the solitary category (via a feed?), but am uncertain as to the other segment. Am truely sorry if I have not been comprehensive enough, and would like to thank you! ^.^

Viewing 11 replies - 1 through 11 (of 11 total)
  • This thread discusses how to accomplish this. I suggest you edit wp-blog-header.php and include the following code at the top:
    if (empty($_GET['cat'])) $cat = '-6';
    Change the six to the ID of the category you’re trying to exclude.

    Thank you!

    Hehe.. 1 more question.. I think know how to go about showing a single omitted category on its own on the side (via a feed?), but how would I go about doing this if I had a number of categories?

    Instead of $cat = "-6", try $cat = "6".

    Yeah, I know I can do that.. Hmm.. Let’s say I used $cat = "-4,-5,-6" and placed the caetgories 1-3 at the left of the page (you can see this already at my site, http://www.vicnan.com). Can I have, at the right, the categories 4-6?

    You can only exclude one category of posts using the $cat = -X. With multiple values, only the first or last one is accepted, I forgot which. I haven’t seen a way around that yet.
    As for the categories lists, if you’re using WP1.2, there’s a <?php wp_list_cats("exclude=X"); ?> function that allows you to build a list of categories with exclusions. Just substitute X for the category ID. And this parameter does take multiple values, ie. exclude=1, 2, 3

    Oh! Thank you, SO very much! *hugxz junesix* Umm.. *regains composure*
    *’.’*

    Hmm.. That allows for another list of cateories; What if I want to show the posts in these categories?

    Does anyone know how to tackle this situation? Thanks!

    I guess I didn’t pick up on exactly what you wanted earlier. It now sounds like you want all the posts of a single category down the left side and all the posts of all the other categories down the right side?

    Hmm, yes! ^.^

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Omission of a category’ is closed to new replies.