This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Category Images in Search Results Not Showing?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Category Images in Search Results Not Showing? Reply To: Category Images in Search Results Not Showing?

#4318
Ernest MarcinkoErnest Marcinko
Keymaster

Yes, we are talking about the same thing.

I think I know why it isn’t working. Version 4.0 just rolled out a few days ago, you might not get a notification from codecanyon.
If you update, this solution should work.

If you don’t want to update (if you have custom code or something applied), then try this code instead, it will probably work with version 3.5:

[code]
add_filter(‘asp_results’, ‘asp_get_woo_term_image’);
function asp_get_woo_term_image($results) {
foreach($results as $k => $result) {
if (function_exists(‘get_woocommerce_term_meta’) && empty($result->image)) {
$thumbnail_id = get_woocommerce_term_meta( $result->id, ‘thumbnail_id’, true );
$image = wp_get_attachment_url( $thumbnail_id );
if (!empty($image))
$results[$k]->image = $image;
}
}
return $results;
}
[/code]