Thumbs in search results

This topic contains 13 replies, has 3 voices, and was last updated by  Axle Themes 5 months, 2 weeks ago.

Viewing 4 posts - 11 through 14 (of 14 total)
  • Author
    Posts
  • #11906

    johnnyd
    Participant

    So the solution for everyone that wants an image next to the article in search results is:

    Edit the theme/template-parts/content-search.php and add the following lines of code after line 21

        <div class="entry-img" style="float:left">
                     <?php
                     if ( has_post_thumbnail() ) { // check if the post Thumbnail
                         the_post_thumbnail(thumbnail);
                     } else { //your default img
                     }
                     ?>
                 </div>

    Then edit styles.css locate the .entry-summary and paste this instead

    .page-content,
    .entry-content,
    .entry-summary {   margin: 15px 0 0;
    	padding-bottom: 100px;
    }

    And you will get the following result:
    search result

    • This reply was modified 6 months ago by  johnnyd.
    • This reply was modified 6 months ago by  johnnyd.
    • This reply was modified 6 months ago by  johnnyd.
    #11917

    Axle Support
    Moderator

    Hi @johnnyd,

    You can give margin or padding right to the image to add a gap between image and content.

    #12093

    johnnyd
    Participant

    Hey mate sorry for the delayed answer that is what I have done in the solution above. And that is why I have highlighted it as an answer. https://axlethemes.com/support-forum/topic/thumbs-in-search-results/page/2/#post-11906

    #12189

    Axle Themes
    Keymaster

    Great

Viewing 4 posts - 11 through 14 (of 14 total)

The topic ‘Thumbs in search results’ is closed to new replies.