[Resolved] header search box

Home Forums Support [Resolved] header search box

Home Forums Support header search box

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1111656
    Chris

    1. This is how my current search box looks like: http://prntscr.com/qeg62z. How do I make it look like this: http://prntscr.com/qeg657.

    #1112048
    David
    Staff
    Customer Support

    Hi there,

    is that the Navigation search you’re looking to ‘change’?

    #1112095
    Chris

    Correct πŸ™‚

    #1112159
    David
    Staff
    Customer Support

    Not possible to customize the nav search like that … what you can do is Hook in your own custom search box.

    1. Create a new Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    2. Add the code i provide here for the custom search field:
    https://generatepress.com/forums/topic/change-search-widget-with-an-icon/#post-1068701

    3. Select the inside_navigation hook and set the Display Rules for the Entire Site.

    Once thats done if you can share a link to the site i can help with the CSS to style it.

    #1112171
    Chris

    Done. I edited the post to include my website URL.

    #1112186
    David
    Staff
    Customer Support

    Try adding this CSS:

    .custom-search-form {
        background-color: #fff;
        order: 5;
    }
    
    .custom-search-form input[type="search"],
    .custom-search-form button {
        background-color: #fff;
        border: 0;
        max-width: 200px;
    }
    #1112215
    Chris

    That works! Is there a way to make the search box a bit smaller?

    Also, the search operation seems like it doesn’t pick up anything. For example, one of my blog posts title is “testing”. When I type “testing” in the search box, it doesn’t show the post.

    #1112350
    David
    Staff
    Customer Support

    1. In the CSS above edit the max-width: 200px; – make that value smaller to reduce the size.

    2. The code you added in the Hook Element … this line:

    <form method="get" class="custom-search-form" action="site-url">

    You need to update site-url to match your sites url πŸ™‚

    #1112354
    Chris

    That worked!

    Amazing support!!! Thank you πŸ™‚

    #1112361
    David
    Staff
    Customer Support

    You’re welcome

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