Wordpress query, exclude latest post from a category
Is it possible to get posts from all categories but exlude only one latest post from specific categories. Something like: get posts from all ca开发者_开发百科tegories, but exclude latest post from category 2,4 and 5. PS. I'm looking for wordpress query (not mysql), for example somethng like
<?php $my_query = new WP_Query('showposts=10'); ?>
Thanks.
How about this:
<?php $my_query = new WP_Query('showposts=10&offset=1'); ?>
Does that work for you?
In MySQL, I would suggest something like this:
SELECT * FROM posts WHERE id NOT IN
(SELECT id FROM posts WHERE category IN (2,4,5) ORDER BY id DESC LIMIT 0,1)
精彩评论