Home › Forums › General Issues › Featured image for custom taxonomy › Reply To: Featured image for custom taxonomy
This document covers getting values from a term https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/
You are doing that incorrectly
$image_id = get_field(‘_thumbnail_id_marque’, ‘term_’ . $term_id);
you can also call this function with the term object instead of "term_{$term_id}"
This document covers using an image field https://www.advancedcustomfields.com/resources/image/
How you use it depends on what you have set as a return value for the image field. But you can always get only the ID value regardless of the return setting by setting the 3rd parameter to false
$image_id = get_field(‘_thumbnail_id_marque’, ‘term_’ . $term_id, false);
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.