在Wordpress循环中获取迭代计数

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Wordpress循环中获取迭代计数相关的知识,希望对你有一定的参考价值。

  1. # Standard Wordpress loop:
  2. $count = $wp_query->current_post + 1;
  3.  
  4. # Custom loop using WP_Query:
  5. $count = $custom_query->current_post + 1;

以上是关于在Wordpress循环中获取迭代计数的主要内容,如果未能解决你的问题,请参考以下文章