所以我创建了一个自定义类别。php中有以下循环:
<div id="category__product-grid" class="row">
<?php
// The Loop
while ( have_posts() ) : the_post(); ?>
<div class="col-md-4 col-product-item">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><div class="cat__featured-img"><?php the_post_thumbnail(); ?></div></a>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
</div>
<?php endwhile;
else: ?>
<p>Sorry, no posts matched your criteria.</p>
</div>
我绞尽脑汁,试图弄明白如何才能从这个循环中排除所需的类别以及所需的帖子。非常感谢您的帮助!