$product_cat_object = get_queried_object();
$axy = get_field('select_artists', 'product_cat_' . $product_cat_object->term_id);
$args = array(
'post_type' => 'product',
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'posts_per_page' => 100,
'terms' => array(var_dump($axy) ),
),
),
);
$product_cat_object = get_queried_object();
$axy = get_field('select_artists', 'product_cat_' . $product_cat_object->term_id);
$args = array(
'post_type' => 'product',
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'posts_per_page' => 100,
'terms' => array(var_dump($axy) ),
),
),
);
Share
Improve this question
edited Jul 5, 2019 at 6:57
Jacob Peattie
44.2k10 gold badges50 silver badges64 bronze badges
asked Jul 5, 2019 at 6:54
varsha choudharyvarsha choudhary
12 bronze badges
2
|
1 Answer
Reset to default -1Use only $axy
instead of 'terms' => array(var_dump($axy) ), ...
It will work, surly. Try it.
'terms' => $axy,
var_dump()
is not the right function to use there. It prints information about the variable and doesn't return anything. – Max Yudin Commented Jul 5, 2019 at 7:16ACF field
,product_cat
andproduct
are linked with each other, with respect to your query? I'm confused with the question. – Aniruddha Gawade Commented Jul 5, 2019 at 9:16