I recently completed a WordPress site design, and I'm just struggling with one bug: when a user clicks the "Search" button without any content in the text field, they are redirected to a list of posts. Is there a way to modify this action? Ideally, if the text field is empty, the user will be redirected to the homepage.
1 Answer
The default WordPress action is to redirect to the homepage when the search is blank - just what you want! Do you have any plugins or .htaccess settings that may be changing this?
-
You're right, thanks very much. I inherited this site from another developer who built the homepage using a template page and didn't include a default index.php file; I've fixed the problem. Thanks! Commented Jul 30, 2011 at 4:29