You can easily filter or exclude categories from the home page and/or the feed. That’s useful to keep them cleaner or, as in my case, to show posts in the visitor’s language.
I’m using this for WP 2.3.3. I show here some of the $query options, just pick the ones you need. This goes in your theme’s functions.php:
function myKewlFilter($query) {
if (($query->is_home) ||($query->is_search) || ($query->is_feed) || ($query->is_archive)) {
$query->set('cat','35, -51');
return $query;
}
}
add_filter('pre_get_posts','myKewlFilter');
The numbers for cat are the category IDs, they are positive to show that category only and negative to exclude all posts from that category. You can find the IDs at Manage | Categories. This won’t work for the category page itself —that’s it, you’ll get the expected category anyway and the filter will be ignored. If you need to do that, read this post about how to combine several categories.
To exclude categories from the prev/next links, use the last two parameters. This excludes the categories 51, 24 and 30:
previous_post_link('« %link','%title', true, '51 and 24 and 30');

Hi
this *filter* is easy, but it *kills* the paged links-next site and previous site.
kindly regards
I’ve heard about issues with the paged navigation (the [1][2][3]… style). Probably there are workarounds for any need, though since I’m just using the usual «prev/next post», which seem to work ok using the trick I posted, probably I’m not going to research them. I’d be glad though to hear about how the category filters work for everyone.
oh yes I’m always around the whole wide world to find new tricks for wp
your espanol category is not found -error 404
category/informatica/ error 404
and this is the second
- I’m sure this is an effect from your filter.
because I have the same troubles by testing it out.
combine this with a query show all articles would work like a charme
regards
I see. In part is normal. Unlike tags, where I use Spanish tags for Spanish posts and English tags for English posts, the categories cover both English and Spanish posts (I use a simple function to translate them); when the blog is filtered by the English category and there aren’t posts in English for the selected category (for example: Books) it won’t find any post matching both English and Books categories.
But it seems there’s a real issue with child categories. While filtered, selecting a parent category shows only posts within the parent. I’ll need to find a fix for that, tho I think I remember reading there wasn’t one.
Thanks for finding it!
Oh and I’m sorry if I don’t explain myself very clearly. Although I’m not a pro designer, I like to write and modify web code. It took me half a week to modify the blog, and did a lot of changes I didn’t really keep track of.
By the way, I liked a lot your retro template.
Oh! thanks for your feedback
A very young girl (the girlfriend of my son) is german and spanisch native speaker. So I’m using her knowledge to translate some articles from you for me
and yes to modify templates is very satisfied
I love it.
regards or *liebe Grüße* Monika