typecho 如何在主循环中获取到当前元素的index

需求

希望在文章前加一个倒序的列表。

不用CID的原因是CID 不连续

相关代码

<?php while($this->next()): ?>
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
            <h2 class="post-title" itemprop="name headline"><a itemprop="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
        </article>
    <?php endwhile; ?>

预期解答

变量名,如$this->index()

阅读 2.3k
2 个回答
$this->sequence
新手上路,请多包涵
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进