WordPress.org

Support

Support » How-To and Troubleshooting » How to add search box to top navigation bar?

How to add search box to top navigation bar?

  • Hoping for some help please. Already have searchform.php file as detailed below. How can I now add search box to top nav bar?

    <form method=”get” id=”searchform” action=”<?php bloginfo(‘home’); ?>/”>
    <div>
    <input onblur=”if(this.value==”) this.value=’type and hit enter to search'” onfocus=”if(this.value==’type and hit enter to search’) this.value=”” type=”text” value=”type and hit enter to search” name=”s” id=”s” />
    </div>
    </form>

    Thanks my website

Viewing 1 replies (of 1 total)
  • You would need to add something like this in your header.php file where you want the search box to appear:

    <div id="search">
         <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    </div>

    Then you can float or add margins like using CSS like such:

    #search {
      float: right;
      margin: 0 20px 20px 0;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘How to add search box to top navigation bar?’ is closed to new replies.