Home › Forums › General Issues › some problem with acf taxonomy › Reply To: some problem with acf taxonomy
Hi @konstantin
Could you please tell me the location rule of the field group? Was it the post, page, taxonomy, or anything else?
Basically, if you call a custom field outside The Loop, you need to provide the ID of the object where you set the location rule. So, if you set the rule to a post, you need to do it like this:
$terms = get_field('taxonomy_field_name', 99);
Where “99” is the ID of the post. If set the location rule to taxonomy, it has different ID structure. This page should give you more idea about it: https://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.