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
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:
[php]
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;
}
[/php]
-
This reply was modified 11 years, 5 months ago by
Ernest Marcinko. Reason: apostrophes