0
我有一个叫做“产品”的wordpress分类法。我知道我的分类模板文件将是taxonomy-product.php但是,当我使用默认的WordPress后循环时,它会显示默认的“Posts”分类的帖子,而不是我自定义的称为“product”的帖子。无法从分类中显示帖子?
我该如何解决这个问题? 这是我的代码,我已经把分类法product.php
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="product">
<?php the_post_thumbnail();?>
<h2 class="product-title">
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</h2>
<a class="product-view" href="<?php the_permalink() ?>">View Product</a>
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>