Search results – or not
-
This also affects earlier versions. If I try and search a wordpress Blog, but forget to enter any terms I end up… on the home page. Surely on a Search, even if blank, I should be redirected to the search results page?
I’ve just sent someone this code (not sure if it’s fully correct) as a suggested interim fix:
function blank_search($query){ global $wp_query; if (isset($_GET['s']) && $_GET['s']==''){ $wp_query->set('s',' '); $wp_query->is_search=true; } return $query; } add_action('pre_get_posts','blank_search');
Is this even possible to correct for a future release?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Search results – or not’ is closed to new replies.