Query Posts Question
-
I am using the following code on my front page for querying recent posts. I am excluding category 3, however this also excludes any posts that have several categories, one of which is category 3 (i.e. a post in category 15 and 3). How can I include these kinds of posts?
<?php $recentPosts = new WP_Query(); $recentPosts->query('showposts=5&cat=-3'); ?> <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Query Posts Question’ is closed to new replies.