Exclude category from Wordpress home page unless it belongs to another category
Posted
by
sirlancelot
on Pro Webmasters
See other posts from Pro Webmasters
or by sirlancelot
Published on 2011-02-09T19:25:07Z
Indexed on
2011/02/09
23:34 UTC
Read the original article
Hit count: 316
Wordpress
I have multiple users adding content to restricted categories (using RoleScoper) in my Wordpress setup that don't show up on the homepage (custom template with query_posts()
).
I'm looking for a way to "promote" the submitted content to the homepage by adding it to another category.
My loop code looks like this:
<?php
query_posts($query_string . '&cat=-37');
if (have_posts()):
while (have_posts()): the_post(); ?>
This will exclude all posts in category 37. However, even if I add the post to a different category it still gets excluded.
Is there a way to exclude a post if it belongs to just that one category?
© Pro Webmasters or respective owner