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

    Hi,

    When I tried to follow the instructions on the following link: https://kriesi.at/support/topic/add-featured-image-to-search-results/, I was confused about where to find the loop-search.php file to place the code. I hope the Enfold team can help clarify this.

    Thank you.

    #1468415

    well it is in the enfold folder : includes.
    If you make a subfolder to your child-themes folder : includes and put the edited loop-search.php inside that folder the search results page will show featured images.
    here is on basis of enfold 6.0.4 the edited file:
    see: https://pastebin.com/3nAyB6Gr
    Changes are made on line 50ff . I inserted some classes to better select them and put the link on the image too.
    download: https://pastebin.com/dl/3nAyB6Gr

    a little css is needed

    .search-result-image {
        display: block;
    }
    .search-result-image img {
        width: 120px;
        border: 1px solid #aaa
    }
    .search-result-image svg {
      width: 120px !important;
      height: auto;
    }
    .search-result-image img {
        width: 120px;
    }
    .search-result-image {
        float: left;
        margin-bottom: 20px;
        padding-right: 30px;
    }
    

    PS: on line 52 you can see that i took the medium image format as source (and not the thumbnail image) – you can change that to anything you like – but medium got one advantage – it is a non cropped image format.

    see: https://webers-testseite.de/?s=web

    #1468517

    Thank you sir for your help, the code is working well. I appreciate your inspiration—medium images are better than thumbnails.

    #1468518

    Hi,
    Glad Guenni007 could help, thank you Guenni007, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

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