Looking to get the advanced custom field from an archive’s taxonomy? All you may need is to call your taxonomy name with the ID.
2 answers
1
Get the custom field from the current archive's taxonomy
To get the custom field from the current archive’s taxonomy, you should use the code below; replacing it with your taxonomy name.
echo get_field( 'acf_field_name', 'thetaxonomy_' . get_queried_object_id() );
Note, the underscore appended to the taxonomy (thetaxonomy_) is important as it acts as a prefix to the taxonomy’s ID.
— Support WizardAnswer 1
0
Getting a custom field from the current WooCommerce category
If you’re trying to get a custom field from the current WooCommerce category, you should use the code below.
echo get_field( 'acf_field_name', 'product_cat_' . get_queried_object_id() );
Notice the use of product_cat_ as the prefix to get_queried_object_id().
— Support WizardAnswer 2