Skip to content

Instantly share code, notes, and snippets.

@Dexterstat
Created April 15, 2014 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dexterstat/10725486 to your computer and use it in GitHub Desktop.
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
$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