Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › How to display terms image ? › Reply To: How to display terms image ?
December 18, 2014 at 2:04 pm
#3275
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 :)