Repeat array inside array through while loop
Start by creating the arguments, but leaving tax_query empty: $args = array( ‘post_type’ => ‘watches’, ‘tax_query’ => array(), ); Then in your loop you can add to tax_querywith $args[‘tax_query’][] =: $args = array( ‘post_type’ => ‘watches’, ‘tax_query’ => array(), ); foreach ( $things as $thing ) { $args[‘tax_query’][] = array( ‘taxonomy’ => $thing[‘taxonomy’], ‘field’ => … Read more