Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter SpyderCanopus

    (@warriortom)

    This is the code for my search box placed in the menu.

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    <div class="search-form">
    <?php $search_text = "Search WarriorTom.com"; ?>
    <form id="searchform' action="<?php bloginfo('home'); ?>/" method="get">
    <input id="s" onfocus="if (this.value == '<?php echo $search_text; ?>') {this.value = '';}"
    onblur="if (this.value == '') {this.value = '<?php echo $search_text; ?>';}" type="text" name="s" value="<?php echo $search_text; ?>" />
    <input id="searchsubmit" type="hidden" /></form></div>
    Thread Starter SpyderCanopus

    (@warriortom)

    I fixed it! Changed the above code into this and it works now:

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    <div class="search-form">
    <?php $search_text = "Search WarriorTom.com"; ?>
    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
        <input onfocus="if (this.value == '<?php echo $search_text; ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $search_text; ?>';}" type="text" value="<?php echo $search_text; ?>" name="s" id="s" />
        <input id="searchsubmit" type="hidden" />
    </form></div>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Searching within the current page or directory instead of entire website’ is closed to new replies.