Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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?

share|improve this answer
    
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! –  daysrunaway Jul 30 '11 at 4:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.