Support

Account

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.