Viewing 2 posts - 1 through 2 (of 2 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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.