query_posts to exclude but also include category
-
At the moment my main page loop excludes a few categories and looks like this:
<?php if ( is_home() ) { query_posts($query_string . '&cat=-5,-15,-20'); } ?>It outputs everything other than the posts in 3 categories(which I output elsewhere).
I sometimes create posts in the excluded categories that I would like to highlight by including them in the main page as well. I assume this could be done by adding the posts to an additional category (say “Main Page” category id 30) and then changing the query or adding another if statement.
I’ve fooled around and tried a few methods I thought might worked but haven’t succeeded.
Thanks a bunch for help.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘query_posts to exclude but also include category’ is closed to new replies.