Im在搜索中使用以下代码。php
<?php if (have_posts() && strlen( trim(get_search_query()) ) != 0 ) : while (have_posts()) : the_post(); ?>
<?php endwhile; else:?> <b>No results match your search.</b> <p>For 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>
功能。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\');
如何在黑色搜索中禁用导航?