Treehouse: Grow your CSS skills. Land your dream job.

WordPress search with custom homepage

  • # December 17, 2011 at 6:35 pm

    Hi guys.

    I have a custom template for my homepage page with the regular search form.

    The problem is that when I click on the submit button it goes for the same page (it just changes the parameters). It wasn’t supposed to call the search.php file?

    # December 17, 2011 at 8:05 pm

    I believe that even though the URL looks the same (with the addition of parameters), it does actually use the search.php as the template. So the address bar won’t actually say something like , but or sometimes just

    Still, this page is built by using the search.php template.

    At least, this is the case with a standard, not-too-customized WordPress installation.

    # December 17, 2011 at 8:53 pm

    Thank you, your answer helped me.

    In my form I changed the text input name, that’s why I was getting the wrong template. It has to be “s”.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.