Hi team,
At the moment, search results on my website just show a list containing text from the product description.
I would like to have the image for products displayed in search results.
Is it possible?
Thanks,
Stephen.
Hi Stephen,
Yes, it’s possible.
Please follow the instructions on this thread: https://kriesi.at/support/topic/display-images-in-search/
Further improvement can be found on this thread: https://kriesi.at/support/topic/change-layout-search-results/#post-1359284
Hope this helps.
Best regards,
Nikko
Thanks Niko.
What worked for me:
PHP
===
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>”;
CSS
===
#top.search-results .search-result-counter {
padding: 0;
}
#top.search-results .search-result-counter img {
border-radius: 0;
height: 100%;
}
#top.search-results .search-result-counter {
height: 200px;
width: 200px;
background: transparent;
}
#top.search-results .template-search.content .entry-content-wrapper {
height: 215px;
}
#top.search-results #main .post-meta-infos {
display: none;
}
#top.search-results .entry-content,
#top.search-results .post-title {
margin-left: 280px;
}
#top.search-results .post-entry {
padding-bottom: 20px;
}
Hi envato99,
I’m glad it helped :)
Just let us know if you still need further assistance.
Best regards,
Nikko