0
votes

Is it possible to get posts from all categories but exlude only one latest post from specific categories. Something like: get posts from all categories, 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.

2

2 Answers

1
votes

How about this:

<?php $my_query = new WP_Query('showposts=10&offset=1'); ?>

Does that work for you?

0
votes

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)