Home › Forums › Front-end Issues › Get Custom Taxonomy Field Value › Reply To: Get Custom Taxonomy Field Value
Hi @BLiN
You say that you have used a taxonomy field to select a taxonomy. Is this a single or multiple select field?
To get the selected taxonomy term, you use the get_field function like so:
$term = get_field('taxonomy_field_name')
Then,make sure you have a return format setting of ‘Object’ instead of ‘ID’.
You can then use $term to load data from the taxonomy term like so:
<?php
// load thumbnail for this taxonomy term
$thumbnail = get_field('thumbnail', $term->taxonomy . '_' . $term->term_id);
?>
Thanks
E
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.