Just paste the following code in either plugin files or in the functions.php ( theme file ).
add_filter( 'request', 'blank_search_fix' );
if(!function_exists('blank_search_fix')){
function blank_search_fix( $query_vars ) {
if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) {
$query_vars['s'] = " ";
}
return $query_vars;
}
}in this code $_GET['s'] denotes the search field in the (search)form
<input type="text" name="s" id="s" value="<?php echo trim( get_search_query() ); ?>" />
No comments:
Post a Comment