I have a product with attribute colors. Attribute values are red, blue and green. I am trying to create a custom search but I can't get the query to pull any product.
$args = array(
'post_type' => array('product'),
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => '_visibility',
'value' => array('catalog', 'visible'),
'compare' => 'IN',
)
),
'tax_query' => array(
array(
'taxonomy' => 'product',
'field' => 'slug',
'terms' => array('blue', 'red', 'green'),
'operator' => 'IN',
),
)
);
$products = new WP_Query( $args );
Where did I go wrong?