Reply To: Thumbnails categories not showing at search results

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

#5413

Ernest Marcinko
Keymaster

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 :)