Skip to content

Instantly share code, notes, and snippets.

@crondeau
Last active August 29, 2015 14:06
Show Gist options
  • Save crondeau/58e192a757efec32cb00 to your computer and use it in GitHub Desktop.
Save crondeau/58e192a757efec32cb00 to your computer and use it in GitHub Desktop.
ge post from multiple taxonomy
<?php
$args = array(
'post_type' => 'your_post_type',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'taxonomy1_label'
'field' => 'term_id',
'terms' => int // this should be an interger - term_ID
),
array(
'taxonomy' => 'taxonomy2_label',
'field' => 'term_id',
'terms' => int
)
)
);
$posts = get_posts( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment