Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #248738

    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

    #248799

    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

    #248803

    Hi Yigit,
    Thanks, I found that earlier, unfortunately the Paste Bin link has been removed.

    #249161

    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Add featured image to search results’ is closed to new replies.