Reply To: category featured image not displaying

Home Forums Product Support Forums Ajax Search Pro for WordPress Support category featured image not displaying Reply To: category featured image not displaying

#3382
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

The only solution is to use a custom filter function. I did a quick search on that plugin, and did a basic code based on this documentation: http://helpforwp.com/plugins/featured-images-for-categories/

Try to put this code to your themes functions.php file:


add_filter( "asp_results", "asp_cfi_image_results", 1, 1 );
     
function asp_cfi_image_results( $results ) {
   
  foreach ($results as $k=>$v) {
    // get the category images
    if ($results[$k]->image != null && $results[$k]->image != "")
       continue;
    if ($results[$k]->date == null || $results[$k]->date == "")
       $results[$k]->image = fifc_get_tax_thumbnail( $results[$k]->id, "category", "thumbnail");
  }
     
  return $results;
}

If the documentation is correct, then this should work. Please note however that I can’t provide 3rd party plugin support, so you might need to check with the plugin developer for the correct function to retrieve the category images. (if his documentation is incorrect or his code changed)

Best,
Ernest Marcinko

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