CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
Other Discussions
Wordpress search with custom homepage
XaviJr
Permalink to comment
#
December 2011
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?
Senff
Permalink to comment
#
December 2011
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.
XaviJr
Permalink to comment
#
December 2011
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".
Add a Comment
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?
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.
In my form I changed the text input name, that's why I was getting the wrong template. It has to be "s".