Are you getting the color
and price
variables from the URL? If so, you need to use $_GET
not $_POST
, and you may want to escape or validate your value.
Also I suggest not defining them as variables, because if there is no value for either of those taxonomies, you don’t need the tax queries (it’ll speed up the query).
Do it like this
$args = array( .....,
'tax_query' => array( 'relation' => 'OR' ),
... );
if( $_GET['color'] )
$args['tax_query'][] = array(
'taxonomy' => 'color',
'field' => 'term_id',
'terms' => $color
);