This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: How to display terms image ?

#3275
Ernest MarcinkoErnest Marcinko
Keymaster

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.