Last active
August 29, 2015 14:06
-
-
Save crondeau/58e192a757efec32cb00 to your computer and use it in GitHub Desktop.
ge post from multiple taxonomy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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