How do I get images (with a thumbnail preview) to show in search results?

enter image description here

The Short Version

I’ve constructed a WordPress site (Gazette theme base) with lots of image media. All have descriptions, captions, and titles but do not show up in search results; using Relevanssi I could get their title and description to appear, but no image was shown! How do I get image media to appear in search results with image thumbnails?

Context:

I’ve built a product portfolio website for a blacksmith. Each page has multiple image galleries: for example, “Custom Pieces” has various types of knives, swords, and other pieces with unique names, “Axes” has various standard axes he produces, and so on. Because customers might be looking for something of a particular description without knowing where it lives they’ll likely do a lot of searching. I’ve found, however, that WordPress’s default search isn’t very helpful and completely excludes image media. If I search for “Damascus”, for example, I would get zero results despite having dozens of images with Damascus in the caption, description, and title! I installed Relevanssi, which causes all of the relevant media to show up in search results, but none of the images are actually displayed:

If the search finds any Post, Page, or other item with a featured image, then the image thumbnail appears. Since images don’t (appear) to have that field, I don’t know how to make them display a thumbnail. I simply don’t know the WordPress API well enough to know where to look or what to do. What PHP calls do I need to make those images appear, or is there a plugin that does exactly what I’m looking for? (I’m not a web developer, but I do have a software engineering background and some basic web experience.)

Thanks in advance!

Read more here:: How do I get images (with a thumbnail preview) to show in search results?

Leave a Reply

Your email address will not be published. Required fields are marked *