Answer the question
In order to leave comments, you need to log in
How to make a selection of products by attributes (taxonomies) in the range between?
tax_query does not have a 'BETWEEN' comparison operator, unlike meta_query. Is it possible to somehow use taxonomies for sampling in the range from and to?
$args['tax_query'][] = array(
'relation' => 'AND',
array(
'taxonomy' => 'pa_vysota',
'field' => 'name',
'terms' => array(140, 1200),
'compare' => 'BETWEEN' //это не работает
)
);
Answer the question
In order to leave comments, you need to log in
There is no BETWEEN in tax_query because the meaning of the search is generally different. Try to userange()
'tax_query' => array(
array(
'taxonomy' => 'pa_vysota',
'field' => 'id',
'terms' => range( 140, 1200 )
)
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question