Support » Themes and Templates » Search page shows nothing if results are not accurate
4 years, 9 months ago
I’m testing a blog I’m building on wordpress and at the moment the search form works OK, but when I search for rubbish words it shows a blank page. Is it possible to tell the search form to display the 404 page?
Let me display the code of my search.php template.
Thanks in advance!
The search page works like this:
the key word you search for is taken and ran through your site. if matches come up, they are show. If not, you are still taken to the search page, because the search button has a action method.
So you could write a function into the search page that says, if nothing is found, return some sort of html or php code.
What function will be great to add KrashKartMedia? Sorry, but I’m not good at php 🙁
thanks for your reply BTW 🙂