Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › How to display terms image ? › Reply To: How to display terms image ?
December 15, 2014 at 1:13 pm
#3235
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 9 years, 4 months ago by Ernest Marcinko. Reason: apostrophes
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)