Archived topic
After Header Content Search Bar Code
6 replies · Started by Kenneth on December 4, 2016
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="submit" id="searchsubmit" value="Search" class="btn" />
</form>
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
Good find, Jamal :)
Be sure to check "Execute PHP" as well.
Thank you very much Jamal. Thank you too Tom, I did not have the PHP box checked initially.
Glad we could help :)
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?
You would have to do that with CSS. Can you link me to the page?