Site logo

[Resolved] cant reduce search box

Home Forums Support [Resolved] cant reduce search box

Home Forums Support cant reduce search box

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2497658
    WPguy

    Hi,

    I’ve tried using the solutions given on this forum to reduce the search box and align it to the right, but the given CSS didn’t work for me.

    Can you help out?

    Screenshot attached.

    Thanks!

    #2497737
    David
    Staff
    Customer Support

    Hi there,

    try adding this CSS:

    nav .navigation-search.nav-search-active {
        max-width: 400px;
        left: unset;
    }
    #2497756
    WPguy

    Thanks, David!

    Just one more thing:

    1) how can I add border color and radius?

    2) Is there any chance to add a prefilled text into the search box?

    Thanks!

    #2497765
    David
    Staff
    Customer Support

    Colors can be set in the Customizer > Colors.
    But as you’re going to need some CSS for the other styles you can do it all there.

    Quick question, apart from adding the placeholder text, any other changes eg. a submit button. As the former will require some PHP so its easier to handle it all in one go 🙂

    #2497771
    WPguy

    Hey David,

    1) Customizer > Colors. I could only find background and text color options for the search box there. So would be great to know the CSS for the borders.

    2) Nope, no submit button is needed, just the placeholder text.

    Thanks, David!

    #2497802
    David
    Staff
    Customer Support

    1. Replace my other CSS with:

    nav.main-navigation .navigation-search  {
        max-width: 400px;
        left: unset;
        right: -10px !important;
        margin-top: auto;
        border-radius: 100px;
        border: 3px solid #000;
        height: 50px;
        top: 5px;
        overflow: hidden;
    }
    nav .navigation-search input[type="search"] {
        height: 45px;
        padding: 2px 20px;
    }
    .main-navigation .menu-bar-item.close-search a {
        background-color: transparent !important;
    }

    2. For the placeholder text you need this PHP Snippet:

    add_filter( 'generate_search_placeholder', function() {
        return 'Search';
    } );
    #2497818
    WPguy

    Thanks, Dave!

    1) Done!

    2) Paste the snippet (I use the code snippets plugin) but no text comes up in the search box. Image attached.

    #2497834
    David
    Staff
    Customer Support
    #2497878
    WPguy

    Awesome! Thanks Dave!

    #2498625
    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.