Reputation:
I am currently working on my new theme, and I have an issue. When I search for something random like "hfdhfsdl", I want it to result in my 404 template, but it only gets header and footer, not the 404 page. My searchform template looks like this:
<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
<div>
<input placeholder="Search for content" type="text" value="" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
Upvotes: 0
Views: 60
Reputation: 3239
404 pages are only displayed when a resource isn't found, they're not intended for empty search results, etc..
When you don't get results back, you must display a "No matches found" or something of that sort.
Upvotes: 3