How to exclude a category from a post query
-
Hi
I was wondering if anyone could help me.
I’ve created a new category on my site and I want to display the posts within a widget instead of with my main reviews. Its going to act as an editorial comments bar, commenting on other news and blogs, with editorial control. I don’t know if I’m approaching it quite the right way, but want to experiment with it this way, as I want it still to ping to twitter and facebook. The site is https://www.jadedeye.com
Anyway I’m using the Equilibrium theme and the query code that it uses is as follows:
<?php query_posts(‘cat=ID&showposts=2’); ?>
What do I need to write in to exclude a category?
There is also the following codes in two other separate areas and have a feeling that I’m going to have to edit these too?
<?php query_posts(‘cat=ID&showposts=1&offset=2’); ?>
and
<?php query_posts(‘cat=-ID&showposts=8&offset=3’); ?>
Thanks
J-P
- The topic ‘How to exclude a category from a post query’ is closed to new replies.