admin管理员组文章数量:1130349
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:?> <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>
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?
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:?> <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>
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?
Share Improve this question asked Dec 29, 2018 at 19:04 Rajesh PatelRajesh Patel 11 silver badge2 bronze badges1 Answer
Reset to default 0Can you try this at search.php
<?php if ( have_posts() && strlen( trim( get_search_query() ) ) != 0 ) : while ( have_posts() ) : the_post(); // Start of the loop.?>
<?php // Do code for the loop. ?>
<?php endwhile; // End of the loop. ?>
<div class="navigation">
<?php
if( function_exists( 'wp_pagenavi' ) ) {
wp_pagenavi();
}
?>
</div>
<?php 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;
?>
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:?> <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>
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?
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:?> <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>
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?
Share Improve this question asked Dec 29, 2018 at 19:04 Rajesh PatelRajesh Patel 11 silver badge2 bronze badges1 Answer
Reset to default 0Can you try this at search.php
<?php if ( have_posts() && strlen( trim( get_search_query() ) ) != 0 ) : while ( have_posts() ) : the_post(); // Start of the loop.?>
<?php // Do code for the loop. ?>
<?php endwhile; // End of the loop. ?>
<div class="navigation">
<?php
if( function_exists( 'wp_pagenavi' ) ) {
wp_pagenavi();
}
?>
</div>
<?php 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;
?>
本文标签: codexHow to disable WpPage Navigation on Blank Search in Wordpress
版权声明:本文标题:codex - How to disable Wp-Page Navigation on Blank Search in Wordpress 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749060323a2310000.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论