I made a custom search form with text fields and dropdown.

Now, my form is in its own template file - sidebar-search.php.

I have also made the searchform.php which should get the data from sidebar and then display results.

I'm using this method for the query.

My problem is this: When I put the "action" to "bloginfo('home')" - nothing happens.
When I put the "action" to "TEMPLATEPATH . 'searchform.php'" - shows a blank page. (this is now updated - see last lines)

Here is the code from searchform.php. Here is the sidebar-search (removed links, check update at the bottom)


I now placed my code in search.php, and here is how it looks like: link

It still just reloads the page and no results are shown.
My action is now like this: action="<?php echo get_bloginfo('home') ?>"

1 Answer 1


I think that your main problem is that you are trying to display the results with searchform.php. That is basically just the form for the search, which you don't need since you have your own form in the sidebar (if I understand you correctly).

The results of a WP search are displayed with "search.php"

  • I have updated the question. I put the code in search.php, but now it just reloads home page
    – Madzgo
    Commented Nov 30, 2012 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.