Multiple, nested tax_query relation

The cat-parameter is not overwritten by tax_query. Instead, it is added to tax_query. Thus, using ‘cat’ => -5, the following array is appended to tax_query: ( [taxonomy] => category [terms] => Array ( [0] => 5 ) [include_children] => 1 [field] => term_id [operator] => NOT IN ) The resulting taxonomy query is built up … Read more

Get term by custom term meta and taxonomy

Try This: $args = array( ‘hide_empty’ => false, // also retrieve terms which are not used yet ‘meta_query’ => array( array( ‘key’ => ‘feature-group’, ‘value’ => ‘kitchen’, ‘compare’ => ‘LIKE’ ) ), ‘taxonomy’ => ‘category’, ); $terms = get_terms( $args );

WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)

Nevermind I (think) I got it… $args = array( ‘post_type’ => ‘product’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, ‘terms’ => array( ‘ring’ ), ), array( ‘taxonomy’ => ‘product_tag’, ‘field’ => ‘slug’, ‘terms’ => array( ‘black’, ‘men’ ), ‘operator’ => ‘AND’ ), ), ); Missing the ‘operator’ => ‘AND’ … Read more