Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[WordPress] A strategy for how to retrieve custom post types tagged with multiple taxonomies.
$args = array(
'post_type' => 'acme_post_type',
'tax_query' => array(
'relation' => 'AND',
'taxonomy' => 'acme_labels'
'field' => 'term_id',
'terms' => 100
'taxonomy' => 'acme_labels',
'field' => 'term_id',
'terms' => 200
$posts = get_posts( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.