Tag Archives: tax_query

WordPress: Querying multiple post types, limiting by individual taxonomies

Apr
8

No Comments - LEAVE A COMMENT

Today I had a case where I needed to create a list of posts from two different post types, which in itself isn’t all that hard using WP_Query(). The catch here was I needed all posts from one post type and just the posts that were in a certain taxonomy from the other. The solution was a simple tax_query() using a relation of “or” and using the “IN” operator to isolate the posts we wanted. This may or may not be the best solution, but it’s the one that worked for us, so I thought I’d share!

CONTINUE READING...