Reply To: How to display terms image ?

#3235

Ernest Marcinko
Keymaster

Hi!

Great! I think this will help. So, based on this article: https://wp-dreams.com/knowledge-base/numbering-the-results/
let me try to put together a similar function. Try to put this code into to your themes functions.php file:

add_filter( "asp_results", "asp_term_image_results", 1, 1 );
  
function asp_term_image_results( $results ) {

  foreach ($results as $k=>$v) {
    // get the term images
    if (isset($GLOBALS["CORE_THEME"]["category_icon_".$results[$k]->id]))
      $results[$k]->image = $GLOBALS["CORE_THEME"]["category_icon_".$results[$k]->id];
  }
  
  return $results;
}
  • This reply was modified 3 years, 8 months ago by  Ernest Marcinko. Reason: apostrophes
Best,
Ernest Marcinko

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