[英]Wordpress number the posts in a category
當我單擊Wordpress上的類別頁面時,它將列出該類別中的所有帖子。 我要做的就是以某種方式編號它們。
這是content.php中的代碼
h2 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
那我需要做一個loop
嗎?
要獲得類別頁面下的總帖子,請將給定代碼放在類別頁面的循環中。
echo $item_query->found_posts;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.