Reply To: How to display terms image ?

#3275

Ernest Marcinko
Keymaster

Hi!

I've looked at those links. There is something that might work:

add_filter( "asp_results", "asp_pods_image_results", 1, 1 );
   
function asp_pods_image_results( $results ) {
 
  foreach ($results as $k=>$v) {
    // get the term images
    if ($results[$k]->image != null && $results[$k]->image != ”)
       continue;
    $pod = pods('category');
    $pod->fetch($category->term_id);
    $icon = $pod->get_field('icon');
    if ($icon != null && $icon != ”)
      $results[$k]->image = $icon;
  }
   
  return $results;
}

I cannot test this code, so it might not work. But I guess it's very close to a solution.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)