Hi there,
I am wanting to display a custom field on my woocommerce category page. I have created a custom field called test_field
. This is showing on my product category page fine, but I cannot get it to show on the front end.
I am trying this in my functions.php
as as this is the file I am using to edit the category page.
echo the_field('test_field');
However, nothing is showing.
Can anyone tell me what I have done wrong?
thanks!
You need to create an action or filter using one of the hooks used on WC template that you are trying to alter.
In your action/filter you need to supply ACF with the second argument ($post_id) to get the field from the correct category.