• Hello,
    I’ve been trying to fiddle with excluding multiple categories from showing up on the index page of my blog. Unfortunately, I’m having a few problems.
    Using $cat = ‘-8′; to exclude category 8 appears to work, although when I try using $cat = ‘-8,-9;’, it seemsto want to ignore the second category number, and still only exclude category 8. I’ve tried fiddling with the syntax of this by leaving out the comma and such, but nothing seems to work.
    It baffles me how using ‘$cat = ‘1,2,3” to only include certain categories does work, but when it comes to excluding, using that same syntax just doesn’t want to work!
    If anyone could offer any enlightenment, it would be much appreciated. (By the way, I have tried using the Show-one-category-on-front-page hack as well, but again, it only works for excluding one category, not multiple categories. ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • I’m having the exact same problem and I have found no solution so far. Does any one know how to fix this issue?

    From wp-blog-header.php:
    // Note: if we have a negative, we ignore all the positives. It must
    // always mean ‘everything /except/ this one’. We should be able to do
    // multiple negatives but we don’t ??
    This would be a nice little project for an enterprising contributor.

    I found I needed to use the hidden-category stuff to really do what I wanted to do. It’d be easy to take that another step and have it hidden-from-frontpage as an option.
    -d

    Can’t you exclude your categories by including only the ones you want? For example you wanted to exclude categories 8 and 9 and your code using $cat= -8, -9 doesn’t work because it only sees the first negative number. Then could this solution work:
    $cat = 1,2,3,4,5,6,7,10,11,12 . Just a thought, since once can exclude by including everything else.

    I’ve found that when I use this category inclusion/exclusion at all, wordpress forgets about the posts per page variable. Is there a fix for this? Am I supposed to do something besides add $cat = “xxx”; to my index.php for this to work as expected?

    I can’t get the script to work at all. Its implemented exactly as stated in both the myhacks.php and the admin section of the site, but when i go to the directory https://www.homocoit.us/hc … nothing. still lists all the categories. There’s not even any error message so I can try and figure out what the problem is.

    I notice that it forget the post per page variable to. I am having the same problem myself. Someone please find a fix.

    danes – it goes in the top of index.php, not in the admin, nor in the my-hacks.php files. Also, are you trying to get it to hide the category link itself? Or posts from that category? Setting $cat (which should only be done when it isn’t already set) only affects the posts displayed on the main page. NOTE: You do realize that you don’t have a default CSS set? I get the raw HTML in all it’s gorey glory with no styling what so ever.
    I used to have the same problem of WP forgetting the posts-per-page setting, but since I’ve moved to Mingus I haven’t had that problem, so I don’t know what’s up with that. Except that based on your source here, I see that it looks like hte 1.0.1 version of WP is running.
    TG

    There’s a plug-in for category exclusions and more (asides, etc.). Supposed to work with 1.5 too. (It’s the one by Ryan Baron – ‘Janitor Prime’? The other one by Kitty doesn’t work on the new revision.

    WP links to it are down though. Found it here:

    https://www.coldforged.org/archives/2004/11/15/wordpress-asides-coldforged-style/

    https://flickr.com/groups_topic.gne?id=6421#comment46452

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Excluding multiple categories’ is closed to new replies.