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

#5425

Ernest Marcinko
Keymaster

Hi!

Thanks for the details. Their documentation was incorrect, it was not working actually. However I have tracked down the method of how to get the thumbnail, it should work now. I have changed the code I've sent you before. For future reference I'm leaving it here:

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;
	$thumb_id = get_option( '_wpfifc_taxonomy_term_'.$result->id.'_thumbnail_id_' );
    if ($thumb_id !== false) {
      $image = wp_get_attachment_url( $thumb_id );
      if (!empty($image))
        $results[$k]->image = $image;
    }
  }
  
  return $results;
}
Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)