Site logo

[Resolved] Search Bar Width Postion

Home Forums Support [Resolved] Search Bar Width Postion

Home Forums Support Search Bar Width Postion

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #249202
    Bobby

    Hello Tom,

    I have question about the search bar in the main nav menu. At this time, when I click the search icon, the search bar stretches all the way across the nav menu. Is there a way to make the search bar do the same…. but stretch out underneath the the main nav bar with the text inside bar saying “Search”.

    Thanks.

    #249210
    Richard Bland

    Hi Bobby,

    Thanks for reaching out.

    I think this one may well be a feature request as it would involve quite a bit of coding to achieve what you are looking for.

    What we can do right now is leave this open for Tom to check in on. I am not aware at this stage any such feature being available for us but he will be able to confirm this for us shortly.

    There some plugins which help to enhance the search facility on a WordPress website, but none that I know of which could replace the actual search bar with have within GP.

    Thanks Kindly

    #249246
    Tom
    Lead Developer
    Lead Developer

    Making it show below it quite easy with some CSS:

    .navigation-search {
        bottom: auto;
        top: 100%;
    }

    Adding the placeholder text is a little more difficult because it involves overwriting the function: https://generatepress.com/forums/topic/enter-predefined-text-in-searchbox/#post-151358

    Let me know if you need more info 🙂

    #249274
    Bobby

    Thanks, that worked great. Hmmm…….I see the “Search” text when I click inside the search form area, but is it a way for the “Search” text to automatically show inside the form area without having to click in the form area??? Hope this makes sense…

    #249543
    Tom
    Lead Developer
    Lead Developer

    The “placeholder” HTML5 attribute will display slightly different in all browsers.

    In Chrome, it should appear right away.

    What browser are you using?

    #249632
    Richard Bland

    Not sure if this will help but I have used this jQuery in the past to help with compatibility issues, but it would require a bit of customisation on your part Bobby:

    https://github.com/mathiasbynens/jquery-placeholder

    #250192
    Bobby

    Hi Tom and Richard,

    I tried it on all browsers, but it did not automatically auto fill with the text “Search.’ I have to click in the search box first and then it comes up. Actually, its no big deal, I’m just happy I got the search box to move down underneath the nav bar. Thank you guys for your help and extra effort in trying to get to work.

    I do have one more last question, but its pertaining to a different topic. I will post it with a new heading, so if someone else might be looking for the answer..they will be able to find it.

    Take care.

    #250193
    Richard Bland

    Hi Bobby,

    If you are confident in putting in your own jQuery that plugin could well help force browsers to display your chosen text. I have used it in the past for a similar reason.

    Thanks kindly though

    #250246
    Bobby

    Hey Tom and Richard,

    I got it working. I overlooked the link Tom provided me that had the code to place in the functions file. Silly me.

    https://generatepress.com/forums/topic/enter-predefined-text-in-searchbox/#post-151358

    Thanks for your help. Thank you Richard for also providing the plugin.

    Take care.

    #250265
    Tom
    Lead Developer
    Lead Developer

    Glad you got it working 🙂

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