我的网站上有3到4个类别。我正在使用WordPress搜索,但是当我搜索类别时,我会得到
没找到
而且,我试图搜索子类别,然后我也收到相同的消息。
您能帮我解决这个问题吗?
search.php
<section id="primary" class="content-area mainSearch">
<main id="main" class="site-main">
<div class="equalPadding">
<div class="cp-seeWrapper">
<?php if ( have_posts() ) :
get_search_form();//search form
?>
<div class="resultCount"><?php
global $wp_query;
echo $wp_query->found_posts.' RESULTS';
?></div>
<div class="row">
<?php
while (have_posts()){the_post();?>
//displaying result here
<?php } ?>
<?php
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</div>
</div>
</div>
</main><!-- #main -->
</section><!-- #primary -->