views:

17

answers:

1

Anyone get this to 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.

A: 

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');
TheDeadMedic
As far as I know, that just spits out the total number of comments. I forgot to specify that I'm trying to get a comment count for each comment to style with it. So, comment #1, #2, etc.
joren
The looping happens *inside* `wp_list_comments()` - the callback is responsible for the output of each comment. Check out twentyten's comment callback `twentyten_comment()` for an example.
TheDeadMedic