• Resolved biggerjim

    (@biggerjim)


    Hiya,

    I’ve added search to a menu. When I enter a term and hit return, the page with the search results is in the “default template” which is a blog page style. The rest of the site uses the “front page” template, so this looks out of character.

    How do I change the search page template?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    Please check this WordPress Codex page:
    https://codex.www.ads-software.com/Creating_a_Search_Page

    Kind Regards, Roman.

    Thread Starter biggerjim

    (@biggerjim)

    Thanks Roman.

    I should have made it more clear that it’s the search results page I’m having problems with, not the search page (I’m actually initiating searches from the menu).

    Hello, here is how that page starts:

    Different WordPress Themes feature different template files. Some include a search.php template file. This is not a Search Page, it is merely a template that displays the search results.

    So I still kindly suggest you to check the link above ??

    Kind Regards, Roman.

    P. S.
    Sydney theme does come with search.php template. So you can just copy it to a child theme folder and edit it there.

    Thread Starter biggerjim

    (@biggerjim)

    Thanks for the replies.

    I’ve created a search.php in my child theme, and can alter it, but the search results page

    https://s733208747.websitehome.co.uk/?s=34

    is still behaving differently from the rest of the pages on my site; for example:

    https://s733208747.websitehome.co.uk/about-us

    The background photo isn’t responding to page size changes the same way, and search results obscure the background pic entirely. Any ideas? Presumably they’re loading different templates… how do I control this?

    • This reply was modified 4 years, 12 months ago by biggerjim.

    Hello, try to use the following CSS code.

    You can add CSS code in Customize → Additional CSS section.

    body.search.search-results.custom-background .page-wrap {
      background-color: rgba(0, 0, 0, 0.7);
    }
    
    body.search.search-results.custom-background .page-wrap .content-wrapper {
      background-color: transparent;
    }
    
    body.search.search-results.custom-background .page-wrap,
    body.search.search-results.custom-background h2 a,
    body.search.search-results.custom-background h3 {
      color: white;
    }
    
    body.search.search-results .page-wrap .hentry {
      padding-top: 10px;
      padding-bottom: 10px;
    }
    
    body.search.search-results .page-wrap .hentry .entry-header {
      margin-bottom: 0;
    }
    
    @media (max-width: 767px) {
      body.search.search-results .page-wrap .content-wrapper {
        margin-left: 20px;
        margin-right: 20px;
      }
    }

    Please feel free to ask any other questions that you might have.

    Kind Regards, Roman.

    Thread Starter biggerjim

    (@biggerjim)

    Brilliant! Thanks a lot Roman!

    You are welcome! ??

    Please feel free to ask any other questions that you might have in future.

    Kind Regards, Roman.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘search results page template’ is closed to new replies.