Home › Forums › Front-end Issues › Displaying Multiple Values from Custom Taxonomy Terms › Reply To: Displaying Multiple Values from Custom Taxonomy Terms
Okay… so another question if you don’t mind. I’m additionally hoping to display an image assigned to this taxonomy term. The image field was also created by ACF (industry_image) in a separate field group and attached to my taxonomy term “industries.”
// grab the "related industries" terms from the current queried object
$related = get_field('related_industries', $queried_object);
// loop through the returned terms and display the name and image
if ($related) {
foreach ($related as $term) {
echo $term->name;
// what I want to display in addition
echo $term->[ACF field assigned to this term, 'industry_image']
}
}
My $related variable above is only including the related_industries field and not the other other custom field, industry_image. Perhaps I need a special query to grab all the custom fields for the current taxonomy term.
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.