Anyone get this t开发者_如何学编程o work at all? In the new theme, comments are populated using wp_list_comments( array( 'callback' => 'theme_comment' ) );
and I have no idea where this is looping, so I don't know where to start counting a new variable. I can alter the layout of the comments in functions.php, but it's just a function and apparently wordpress is somehow using it only once to populate multiple comments.
If you just want the comment count, why not get_comments_number()
?
UPDATE:
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');
精彩评论