exclude category from blog
-
Hello all!
I found code to exclude a category from a blog I’m working on (which is not the homepage), but something happened (no idea what) and the categories are not being filtered out. Any ideas where I should look? What is the the standard practice/code to use… I was originally using the following in my template-blog.php (index.php is not an active page in the theme – it only provides instructions during setup):
<?php
query_posts($query_string . ‘&cat=-7’); //excludes category ID 7
//continue regular WP loop
if (have_posts()) :
while (have_posts()) : the_post();
//display posts
endwhile;
else :
//show errors
endif;
?>And it was working… the client logged in and added a few posts… and suddenly I can’t for the life of me get it to work! HELP!!!
The topic ‘exclude category from blog’ is closed to new replies.