How to disable Wp-Page Navigation on Blank Search in Wordpress
Im using the Following Code in search.php
?php if (have_posts() strlen( trim(get_search_query()) ) != 0 ) : while (have_posts()) : the_post(); ?
?php endwhile; else:? bNo results match your search./b pFor Accurate results, Please Search the Model Number of the device or the Brand Name./p ?php endif; ?
div class="navigation"?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ? ?php } ?/div
Functions.php:
function SearchFilter($query) {
// If 's' request variable is set but empty
if (isset($_GET['s']) empty($_GET['s']) $query-is_main_query()){
$query-is_search = true;
$query-is_home = false;
}
return $query;}
add_filter('pre_get_posts','SearchFilter');
How to disable the navigation in black search?