[Resolved] After Header Content Search Bar Code

Home Forums Support [Resolved] After Header Content Search Bar Code

Home Forums Support After Header Content Search Bar Code

  • This topic has 6 replies, 4 voices, and was last updated 7 years ago by Tom.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #251292
    Kenneth

    Could I get some help with a code to place in the after header content hook for a search bar. I was using the one below before a site crash recently, but it is not working correctly on a localhost environment now. Should I be adding a php as well? I’m sure it is an easy fix but this is day three of working on it with no luck on my end.

    <form method=”get” id=”searchform” action=”<?php bloginfo(‘home’); ?>/”>

    <input type=”text” size=”10″ value=”<?php echo wp_specialchars($s, 1); ?>” name=”s” id=”s” />
    <input type=”submit” id=”searchsubmit” value=”Search” class=”btn” />

    </form>

    #251312
    Jamal

    Hi Kenneth,

    I think nearly all you need is this <?php get_search_form(); ?>

    https://generatepress.com/forums/topic/big-search-bar-in-center-in-header/#post-127251

    #251327
    Tom
    Lead Developer
    Lead Developer

    Good find, Jamal ๐Ÿ™‚

    Be sure to check “Execute PHP” as well.

    #251416
    Kenneth

    Thank you very much Jamal. Thank you too Tom, I did not have the PHP box checked initially.

    #251445
    Tom
    Lead Developer
    Lead Developer

    Glad we could help ๐Ÿ™‚

    #311763
    Stuart

    I’m using the code below

    <?php get_search_form(); ?>

    in a hook but I would like the search box to extend the width of the container, can some advise me what I need to add to the code?

    #311810
    Tom
    Lead Developer
    Lead Developer

    You would have to do that with CSS. Can you link me to the page?

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