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; ?>