Support » Themes and Templates » Search page shows nothing if results are not accurate

  • hildergarn

    (@hildergarn)


    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • KrashKartMedia

    (@krashkartmedia)

    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.

    hildergarn

    (@hildergarn)

    What function will be great to add KrashKartMedia? Sorry, but I’m not good at php 🙁

    thanks for your reply BTW 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search page shows nothing if results are not accurate’ is closed to new replies.