All the API functions can be used with a taxonomy term, however, a second parameter is required to target the term ID. This is similar to passing through a post_id to target a specific post object.
The $post_id needed is a string containing the taxonomy name + the term ID in this format: “$TaxonomyName_$TermID”
Display a field
<p><?php the_field('field_name', 'thetaxonomyname_7'); ?></p>
Sorry @yasir.shinedezign, is not clear what you say…
Please check this page http://www.advancedcustomfields.com/resources/field-types/image/ for documentation on how to get a value from a file/image field.
I bet that you need to call it inside a hook, in order to use it.
Where did you put that code?
Try to call it inside hook “init” or “wp”.
Please @haikbvn, post the “print_r” result here.
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!
© 2022 Advanced Custom Fields.