Reputation: 269
I have this ACF field:
Field Name: brand
Field Type: Taxonomy
Taxonomy: pa_brand
WooCommerce Product Attribute:
Name: brand
slug: brand
term id: 51
value: ASUS
I’m trying these codes but it doesn’t work:
<?php the_field(‘brand’, $term); ?>
<?php the_field(‘brand’, ‘product_51’); ?>
Or how will I know the category to use if I’m wrong.
Upvotes: 0
Views: 499
Reputation: 473
pass a object to the the_field() method see below code
$obj = get_queried_object();
the_field(‘brand’, $obj);
Upvotes: 1