简体   繁体   English

WordPress编号类别中的帖子

[英]Wordpress number the posts in a category

When I click on a category page on Wordpress, it lists all the posts in that category. 当我单击Wordpress上的类别页面时,它将列出该类别中的所有帖子。 All I want to do is number them somehow. 我要做的就是以某种方式编号它们。

Here is the code in content.php 这是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>

So would I need to do a loop or something? 那我需要做一个loop吗?

要获得类别页面下的总帖子,请将给定代码放在类别页面的循环中。

 echo $item_query->found_posts; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM