Okay
  Public Ticket #1167786
Search results post image
Closed

Comments

  •  2
    Alessandro started the conversation

    Hi Paul how are you ?

    Excuse me are you planning to modify the theme to show the main image of the post/page/ptf in the search results ?

    By now the results page shows only the title and description of the post/page/ptf.

    Thank you and take care!!

    Alex

  •  296
    Paul replied

    Hi Alex,

    I am afraid I currently do not have a plan for that. But you can manually customize the code a bit with some custom CSS to show the image on the search results page.

    First, I would suggest creating a new child theme to be used for the customization. Please read here for more info: https://uxbarn.ticksy.com/article/8649/

    Then you can override the "index.php" file in the child theme. Just edit this line of code in the file:

    <?php if ( ! is_search() ) : // Do not display the thumbnail on some templates ?>

    Change it to:

    <?php if ( true ) : // Do not display the thumbnail on some templates ?>
    

    Then apply this custom CSS to adjust the image display:

    .search-results .post-image {
        float: none;
        margin: 0 auto 30px;
        width: 94.9%;
    }
    .search-results .post-image img {
        margin: auto;
    }
    

    This is only the guideline. You can customize it as you want here. I hope this helps!

    Regards,
    Paul

  •  2
    Alessandro replied

    Super and huge thanks Paul !!!

    Take care ;)

  •  296
    Paul replied

    You're welcome, Alex! Happy to help!