Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › How to display terms image ? › Reply To: How to display terms image ?
Hi!
I’ve looked at those links. There is something that might work:
[php]
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;
}
[/php]
I cannot test this code, so it might not work. But I guess it’s very close to a solution.