Hi,
When I search using the magnifying glass in the header the search results show only text, I would like the featured image for the product to appear within search results. I am using the Relevanssi plug in to ensure only products appear.
Thanks
Hi AscenderDesign!
Please refer to Ismael’s post here – https://kriesi.at/support/topic/adding-featured-images-to-the-search-result/#post-214936
Cheers!
Yigit
Hi Yigit,
Thanks, I found that earlier, unfortunately the Paste Bin link has been removed.
Hey!
Thank you for using the theme!
Please edit includes > loop-search.php, find this code on line 33:
echo "<span class='search-result-counter {$counterclass}'>{$post_loop_count}</span>";
Replace it with:
$searchthumb = get_the_post_thumbnail( $the_id, 'large' );
echo "<span class='search-result-counter {$counterclass}'>{$searchthumb}</span>";
Add this on Quick CSS or custom.css:
.search-result-counter {
padding: 0;
}
.search-result-counter img {
width: 100%;
height: 100%;
border-radius: 100px;
}
This will add the featured image on the search counter. You can change the style using the selectors above.
Cheers!
Ismael