Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › How to display terms image ? second › Reply To: How to display terms image ? second
December 19, 2014 at 9:57 am
#3279
Thanks, got them.
Just needed a minor modification, the final code is:
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("stores");
$pod->fetch($results[$k]->id);
$icon = $pod->get_field("icon");
if ($icon != null && $icon != "")
$results[$k]->image = $icon;
}
return $results;
}
It should work now.
Best,Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)