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 http://www.yourwebsite.com/search.php?s=bla , but http://www.yourwebsite.com/index.php?s=bla or sometimes just http://www.yourwebsite.com/?s=bla

    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.

*May or may not contain any actual "CSS" or "Tricks".