WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. emberjd123
    Member
    Posted 1 year 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'); ?>/">
    <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

  2. Josh (WP Edit)
    Member
    Posted 1 year ago #

    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;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic