任何人都可以使用它吗?在新主题中,使用wp_list_comments(array('callback'=>'theme_comment'))填充注释;
我不知道这是循环的,所以我不知道从哪里开始计算一个新变量。我可以改变functions.php中注释的布局,但它只是一个函数,显然wordpress只是一次使用它来填充多个注释。
答案 0 :(得分:2)
如果您只想要评论计数,为什么不get_comments_number()
?
更新:
function my_comment($comment, $args, $depth)
{
static $count = 1;
// do your comment output - $count will increase on each iteration
// you could copy and paste twentyten's comment callback code here
$count++;
}
wp_list_comments('callback=my_comment');