Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #242114

    Hi There,
    Is it possible to add images to the search result in Enfold Theme.
    I have seen few questions and answers on the forum but none of them worked for me.
    Regards
    G_T_M

    #242517

    Hey G_T_M!

    Please refer to this link: https://kriesi.at/support/topic/adding-featured-images-to-the-search-result/

    This should use the featured images of posts and pages for search results.

    Best regards,
    Ismael

    #242736

    Hi Ismael,
    I have seen the post but the pastebin link is expired and this is why I have asked the same question again.

    You need to set featured images for all pages then edit includes > loop-search.php. Remove everything and replace it with this: http://pastebin.com/pbp2z3x2

    PS. Generally I find everything what I’m looking for – good support!
    Regards
    G_T_M

    #243677

    Hi!

    Open up includes/loop-search.php and replace:

    
    echo "<h2 class='post-title entry-title'><a title='".the_title_attribute('echo=0')."' href='".get_permalink()."' $markup>".get_the_title()."</a></h2>";
    

    with

    
    $slider = get_the_post_thumbnail(get_the_ID(), 'entry_without_sidebar');
    if($slider) $slider = '<a href="'.get_permalink().'">'.$slider.'</a>';
    if($slider) echo '<div class="big-preview">'.$slider.'</div>';
    echo "<h2 class='post-title entry-title'><a title='".the_title_attribute('echo=0')."' href='".get_permalink()."' $markup>".get_the_title()."</a></h2>";
    

    Cheers!
    Peter

    #244130

    Peter,
    It works. Thank you.
    Regards
    G_T_M

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Adding Images to the Search Result’ is closed to new replies.