The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Already Got searchform.php file, how to add to top nav bar? (3 posts)

  1. emberjd123
    Posted 3 years ago #

    Already have searchform.php file as detailed below. How can I now add search box to top nav bar, on right hand side?

    <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. Amy Hendrix (sabreuse)

    Posted 3 years ago #

    Add <?php get_search_form(); ?> to whatever location you want it to appear in -- presumably the <nav> or <div> element that holds your navigation. You'll also want to add #searchform {float: right;} to your CSS if it isn't there already.

  3. emberjd123
    Posted 3 years ago #

    Thanks v much for your reply.

    New to this, so hoping you can point me in the right direction. Under css stylesheet I got:

    My last bit of coding under the header is:
    <div id="header">
    <img src="<?php bloginfo('template_url'); ?>/images/header.gif" alt="insurance"/>
    <?php wp_nav_menu('menu=topnav'); ?>

    Would I put your coding above the </div> under the header?

Topic Closed

This topic has been closed to new replies.

About this Topic