Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › No images showing › Reply To: No images showing
May 28, 2019 at 9:20 am
#22899
Keymaster
Hi Wayne,
Thanks, I think I was able to resolve this. Based on the theme files, I have constructed and added the following code to the functions.php file in the child theme directory:
add_filter('asp_results', 'asp_fix_images_for_auction_theme', 10, 1);
function asp_fix_images_for_auction_theme( $results ) {
foreach ( $results as $k => &$r ) {
if ( isset($r->post_type) ) {
$id_of_firstpic = AuctionTheme_get_first_post_image_post_id($r->id);
if ( !empty($id_of_firstpic) ) {
$im = AuctionTheme_get_post_images_first($r->id,4);
$img = AuctionTheme_wp_get_attachment_image($im, array(900, 700));
$r->image = $img;
}
}
}
return $results;
}
It should display the images now.