I’m looking to pull a repeater field from a product category that is not on the archive page
I can’t use get_queried_object();
because its not on the archive page, I’ve tried with get_term_by();
with no luck.
The following works fine on the archive page:
$term = get_queried_object();
if( have_rows('repeater', $term) ) {
while( have_rows('repeater', $term) ) {
the_row();
echo get_sub_field('name');
}
}
I’ve tried following on a page but it does not show the repeater fields
$term = get_term_by('id', 112, 'product_cat', 'ARRAY_A');
if( have_rows('repeater', $term) ) {
while( have_rows('repeater', $term) ) {
the_row();
echo get_sub_field('name');
}
}
Basically, I want to get the product category by the ACF repeater field from a regular page
Basically, I want to get the product category by the ACF repeater field from a regular page
can’t make another edit but I think I need to clarify what I want to do…
I want to do a WP_Query with a search term that would go through the ACF repeater field and return the category if that entry exists.