I've created a custom theme and a page template page-search.php
, because the original search will search under the homepage url.
The page works just fine without query string but when I add /?s=1
at the end of the URL I get a 404, why is that?
Thanks
?s=1
in the URL then WordPress interprets that as a search query, searches for posts containing "1", then tries to load search.php from the theme, or index.php if it doesn't exist.s
, so unless your custom search page also matches the search it will find nothing. A page and a page template aren't how you should customize the URL of your searchindex.php
? Are you aware ofhome.php
andfrontpage.php
?