Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #805227

    Hi there awesome support team,

    I’m looking to do just what the below thread covered, but the link with the info is not longer available. Any chance it could be re added?

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

    #805253

    well look to find the loop-search.php in enfold/includes
    make a copy of it and upload an edited version to your child-theme subfolder includes. (commonly it is: enfold-child/includes )

    how to edit :
    look to line (version Enfold 4.0.7) : 31

    echo "<span class='search-result-counter {$counterclass}'>{$post_loop_count}</span>";
    

    and replace it with:

    $searchthumb = get_the_post_thumbnail( $the_id, 'large' );
    echo "<span class='search-result-counter {$counterclass}'>{$searchthumb}</span>";

    and add this to quick css:

    .search-result-counter {
        padding: 0;
    }
    
    .search-result-counter img {
    	width: 100%;
    	height: 100%;
    	border-radius: 100px;
    }
    • This reply was modified 7 years, 6 months ago by Guenni007.
    #805258

    if you like to have both a counter number and than a featured image above the title same line
    big advantage – if there is no featured image – counter is still there – and only image is missing

    find:

    echo "<span class='search-result-counter {$counterclass}'>{$post_loop_count}</span>";
    

    replace with:

    
    $searchimage = get_the_post_thumbnail( $the_id, 'large' );
    echo "<span class='search-result-image'>{$searchimage}</span>";
    echo "<span class='search-result-counter {$counterclass}'>{$post_loop_count}</span>";

    you see the line stays in the code but two lines are added before

    then you only have to style the featured image size f.e.:

    .search-result-image img {
        width: 300px;
    }
    • This reply was modified 7 years, 6 months ago by Guenni007.
    #806731

    Hi,

    Please follow @Guenni007’s suggestion. :)

    Best regards,
    Ismael

    #806811

    That’s great everyone, thank you so much!

    #807193

    Hi,

    Glad we could help and thanks @guenni007 for helping out :-)

    Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #808939

    That’s everything.

    Thank you all!!

    #809212

    Hi,

    Thanks for letting us know. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Show featured images in search results page’ is closed to new replies.