Site logo

[Resolved] Big search bar in center in header

Home Forums Support [Resolved] Big search bar in center in header

Home Forums Support Big search bar in center in header

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #127240
    Dhruv

    Hi Sir

    How can I create header like this.
    http://i.imgur.com/xLmAIH3.jpg

    I want to create big search bar between Logo (in left) and cart (in right).

    Pls help

    Regards

    #127251
    Tom
    Lead Developer
    Lead Developer

    You could use GP Hooks to add the HTML/PHP in, and then you would have to use CSS to style it.

    Your hook content would look something like this:

    <div class="grid-20">
          Logo in here
    </div>
    <div class="grid-60">
          <?php get_search_form(); ?>
    </div>
    <div class="grid-20">
          Other stuff in here
    </div>
    #127322
    Dhruv

    Thanks Tom. You are Genius 🙂
    But how can I increase width of search form ?

    #127323
    Dhruv

    Is this code okay ?

    input[type=”search”] {
    box-sizing: content-box;
    width: 500px;
    }

    #127377
    Tom
    Lead Developer
    Lead Developer

    This might be better:

    .site-header input[type="search"] {
          box-sizing: content-box;
          width: 500px;
    }
    #127421
    Dhruv

    Thanks Sir

    #127422
    Tom
    Lead Developer
    Lead Developer

    No Problem 🙂

    #172955
    Chris

    Is there a way to size and float the Search Box (aligned to the right) over the header image so it’s near the upper-right area of the header?

    #173000
    Tom
    Lead Developer
    Lead Developer

    Any examples of what you’re trying to do?

    #173165
    Tom
    Lead Developer
    Lead Developer

    Try this:

    1. Add the search widget into the “Header” widget area in “Appearance > Widgets”.

    2. Add this CSS:

    .inside-header {
        position: relative;
    }
    
    .header-widget {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    Adding CSS: https://generatepress.com/knowledgebase/adding-css/

    You might need to adjust the positioning a bit.

    #173228
    Chris

    Worked perfectly! Thanks!

    #173262
    Tom
    Lead Developer
    Lead Developer

    You’re welcome!

    As for your email, you can style the search field like this:

    .header-widget .search-field {
        font-size: 15px;
        padding: 10px;
    }

    Add as much CSS in there as you like 🙂

    #173628
    Chris

    Worked nicely. Thank you!

    #173648
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #445182
    Steve

    Hi Tom,

    Where abouts would I put this code? Which hook do I use to replace the default header on every page?

    Thanks

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