Support

Account

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 🙂