Exclude categories not working
-
I have 2 loops on a page the first using:
query_posts("&cat=6&posts_per_page=3") if (have_posts()) : while (have_posts()) : the_post(); ?>
the second using:
$my_query = new WP_Query("&cat=-5,-6,-7&posts_per_page=5"); while ($my_query->have_posts()) : $my_query->the_post();
The exclusion doesn’t seem to want to work though. If I change the second loop to:
$explorerhome_query = new WP_Query("&cat=7&posts_per_page=5"); while ($my_query->have_posts()) : $my_query->the_post();
Then that shows just Category 7 posts fine, but as an exclusion it doesn’t want to know.
Are there any obvious errors I am making here? I’m new to this so it’s likely!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Exclude categories not working’ is closed to new replies.