How to add search box to top navigation bar? (2 posts)

  1. emberjd123
    Posted 3 years ago #

    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'); ?>/">
    <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" />

    Thanks my website

  2. 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"); ?>

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

    #search {
      float: right;
      margin: 0 20px 20px 0;

Topic Closed

This topic has been closed to new replies.

About this Topic