Support

Account

Home Forums General Issues How do you display Advanced Custom Fields in taxonomy-product_cat.php? Reply To: How do you display Advanced Custom Fields in taxonomy-product_cat.php?

  • I’m not sure. Are you sure about the taxonomy name being “product_cat_” I’m assuming it is based on the name of the template file being used.

    and you may need your action and function that you’d normally use for woocommerce. I don’t know a lot about how ACF plays with woocommerce.

    What I do know is that your original code the_field('custom_category_content'); was not working because you were not supplying it with the needed id value to get the value of a custom field that is attached to a term according to the ACF doc (http://www.advancedcustomfields.com/resources/functions/the_field/)

    You can make sure that $term_id = get_queried_object()->term_id; is returning a valid term ID.

    $object = get_queried_object();
    echo $object->term_id;

    you can even check the entire queried object to see what’s in there

    object = get_queried_object();
    print_r($object);