repeat array inside array through while loop

I want to repeat this array

array(
‘taxonomy’ => $tax,
‘field’ => ‘slug’,
‘terms’ => $cat,
),

because I am getting the value of taxonomy and categories from custom sub field

$args = array(‘post_type’ => ‘watches’, ‘tax_query’ => array(

array(
‘taxonomy’ => $tax,
‘field’ => ‘slug’,
‘terms’ => $cat,
),
array(
‘taxonomy’ => $taxonomy_2,
‘field’ => ‘slug’,
‘terms’ => $cat_2,
),
array(
‘taxonomy’ => $taxonomy_3,
‘field’ => ‘slug’,
‘terms’ => $cat_3,
),
),
); ?>

Read more here:: repeat array inside array through while loop

Leave a Reply

Your email address will not be published. Required fields are marked *