Support » Fixing WordPress » search form on page itself, not the template

  • I’ve created a custom template and can get a search form working if it’s in the custom template. I need a search field on the page itself, i.e., where an end-user would edit the page content (above and below the field). Is this possible?


    The top search field (“Search Upcoming Tours”) below the first paragraph doesn’t work. It’s on the page, not the template. The bottom search field (“Search Previous Tours”) which is actually in the custom template does work.

    Thanks for any help you can provide.

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is the code I used (on the page) –A variant of it is in the template for the second field:

    <div style=”width:440px;height:30px;”>
    <form method=”get” id=”searchform” action=”<?php bloginfo(‘url’); ?>/”>
    <label class=”hidden” for=”s”><?php _e(‘Search for:’); ?></label>
    <table><tr><td>Search Upcoming Tours: </td><td><input style=”width:150px;” type=”text” value=”Type in a country name” name=”s” id=”s” onfocus=”if (this.value == ‘Type in a country name’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘Type in a country name’;}” /></td><td><input type=”submit” id=”searchsubmit” value=”Search” /></td></tr></table>
    <input type=”hidden” name=”taxonomy” value=”tours”>
    <input type=”hidden” name=”term” value=”2013″>
    <input type=”hidden” name=”orderby” value=”date”>
    <input type=”hidden” name=”order” value=”asc”>

    My son figured this out for me. We replaced the php code in the form action with the domain: and everything works.

    <form method=”get” id=”searchform” action=””>

    Sorry for the bother.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘search form on page itself, not the template’ is closed to new replies.