Home › Forums › ACF PRO › How do you setup a Category Taxonomy in a function within Functions.php ? › Reply To: How do you setup a Category Taxonomy in a function within Functions.php ?
You need to pass the ID of the category where the image is located. If you add the image to a category with the ID of 1, for example, you need to use this code:
$cat_id = '1';
the_field('image', 'category_' . $cat_id);
Or:
the_field('image', 'category_1');
This page should give you more idea about it: http://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/.
I hope this helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.