Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Thumbnails categories not showing at search results › Reply To: Thumbnails categories not showing at search results
July 27, 2015 at 10:12 am
#5413
Hi!
So I checked the plugin documentation, and it looks like it’s there is a function to get the term image. Based on that I put together this small snippet:
add_filter('asp_results', 'asp_get_fifc_term_image');
function asp_get_fifc_term_image($results) {
foreach($results as $k => $result) {
if ($result->content_type != 'term') continue;
if (function_exists('fifc_get_tax_thumbnail') && empty($result->image)) {
$image = fifc_get_tax_thumbnail( $result->id, $result->taxonomy, 'thumbnail');
if (!empty($image))
$results[$k]->image = $image;
}
}
return $results;
}
Try to add this code to your active Theme functions.php file. It will try to get the images for each category after the search is done post processing.
Best,Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
![](https://wp-dreams.com/assets/envato/comment-button-knowledgebase.png)
![](https://wp-dreams.com/assets/envato/comment-button-support.png)
![](https://wp-dreams.com/assets/envato/comment-button-facebook.png)
![](https://wp-dreams.com/assets/envato/comment-button-twitter.png)