Support » Fixing WordPress » Creating a searchbox (not working)

  • Resolved sugar01

    (@sugar01)


    Hi,

    I want to create a searchbox on my blog, but I can’t get it to work. More frustrating is that I don’t know what is wrong with it at the moment. Im using WordPress 2.8.4 (Dutch) with the Tidalblue theme.

    I have the file searchform.php in my theme directory wit this code in it:

    <form role="search" method="get" id="searchform" action="<?php bloginfo('url'); ?>">
        <div><label class="screen-reader-text" for="s">Search for:</label>
            <input type="text" value="" name="s" id="s" />
            <input type="submit" id="searchsubmit" value="Zoek" />
        </div>
    </form>

    I also made a WordPress page that includes searchform.php (I use Exec-PHP plugin for executing php in posts and pages)

    <?php include (TEMPLATEPATH . '/searchform.php'); ?>

    When searching via the WordPress page or a searchwidget nothing happens except that the URL changes to http://www.url.com/?s=searchterm and the frontpage is loaded. In other words searching behaves like an anchor to my frontpage.

    I have no idea what to do next to make this work, please help.

    Sugar

Viewing 1 replies (of 1 total)
  • Thread Starter sugar01

    (@sugar01)

    I don’t often ask for help, but when I do not much later I find the problem.

    I copied search.php from the Default theme and saved it to my Tidalblue theme template folder. Now I get a page that shows the searchresults 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Creating a searchbox (not working)’ is closed to new replies.