Created
April 15, 2014 11:43
-
-
Save Dexterstat/10725486 to your computer and use it in GitHub Desktop.
wp_query select post that are specific to a caetgory, with a taxonomy and numer of post and page numver
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
$args = array( | |
'post_type' => 'post', | |
'tax_query' => array( | |
'relation' => 'AND', | |
array( | |
'taxonomy' => 'movie_genre', | |
'field' => 'slug', | |
'terms' => array( 'action', 'comedy' ) | |
), | |
array( | |
'taxonomy' => 'actor', | |
'field' => 'id', | |
'terms' => array( 103, 115, 206 ), | |
'operator' => 'NOT IN' | |
) | |
), | |
'posts_per_page' => 1, | |
'post__not_in' => $sticky, | |
'paged' => $paged, | |
'cat' => 3, | |
); | |
$query = new WP_Query( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment