WordPress, conditional arguments in wp_query, OR

Is this possible to add a condition OR to wp_query? Something like conditional arguments.
Here is what I’m trying to accomplish:

Regular posts (post type ‘post’) in categories (by id): 10, 20, 30.
Post of other type (post type ‘folio’).

Read More

I’m trying to create a query (wp_query), which will display last 3 posts of type:

  • ‘post’ from categories 10, 20, 30

OR

  • ‘folio’

So, if last three post by date are the posts of type ‘folio’, the ‘category__in’ will be skipped in the wp_query.

thanks.

Related posts

Leave a Reply

1 comment

  1. As I know, It is not possible to make the conditions in the query itself, but of course it is possible to use conditionnal statements inside the loop. In other words, use a global query satisfiying all your needs, and then use || in the results to express your OR.