WordPress.org

Ready to get started?Download WordPress

Forums

Omission of a category (12 posts)

  1. pvicnan
    Member
    Posted 10 years ago #

    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! ^.^

  2. skippy
    Member
    Posted 10 years ago #

    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.

  3. pvicnan
    Member
    Posted 10 years ago #

    Thank you!

  4. pvicnan
    Member
    Posted 10 years ago #

    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?

  5. skippy
    Member
    Posted 10 years ago #

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

  6. pvicnan
    Member
    Posted 10 years ago #

    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?

  7. junesix
    Member
    Posted 10 years ago #

    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

  8. pvicnan
    Member
    Posted 10 years ago #

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

  9. pvicnan
    Member
    Posted 10 years ago #

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

  10. pvicnan
    Member
    Posted 10 years ago #

    Does anyone know how to tackle this situation? Thanks!

  11. Anonymous
    Unregistered
    Posted 10 years ago #

    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?

  12. pvicnan
    Member
    Posted 10 years ago #

    Hmm, yes! ^.^

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.