Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Images not showing on search › Reply To: Images not showing on search
November 21, 2015 at 9:19 am
#6692
Hi!
No problem, I’ve found the previous topic and fixed it again 🙂 For future reference, the following code was added to your theme functions.php file:
if (!function_exists("parse_tpl_image")) {
add_filter( "asp_results", "parse_tpl_image", 1, 1 );
function parse_tpl_image($results) {
foreach ($results as $k => $result) {
if ($result->image == null || $result->image == "") {
$m = bdw_get_images_plugin($result->id, 'directory-single-thumb');
if (is_array($m) && isset($m[0]['file'])) {
$results[$k]->image = $m[0]['file'];
}
}
}
return $results;
}
}
Best,Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)