wp tax query

Solutions on MaxInterview for wp tax query by the best coders in the world

showing results for - "wp tax query"
Maylis
06 Mar 2020
1//simple
2'tax_query' => array(
3    array(
4        'taxonomy' => 'people',
5        'field'    => 'slug',
6        'terms'    => 'bob',
7    ),
8),
9
10//more complicated
11'tax_query' => array(
12    'relation' => 'OR',
13    array(
14        'taxonomy' => 'category',
15        'field'    => 'slug',
16        'terms'    => array( 'quotes' ),
17    ),
18    array(
19        'relation' => 'AND',
20        array(
21            'taxonomy' => 'post_format',
22            'field'    => 'slug',
23            'terms'    => array( 'post-format-quote' ),
24        ),
25        array(
26            'taxonomy' => 'category',
27            'field'    => 'slug',
28            'terms'    => array( 'wisdom' ),
29        ),
30    ),
31),
Han
29 Mar 2017
1'tax_query' => array(
2    array(
3        'taxonomy' => 'video_type',
4        'terms' => 'episode',
5        'field' => 'slug',
6        'include_children' => true,
7        'operator' => 'IN'
8    )
9),
10