You can keep up on the latest plugin announcements and tutorials by visiting Greg's Plugins.
Please also see the README file distributed with this plugin, and for details on how to wrap the following functions in conditionals so your theme will only rely on this plugin when it is activated, please see: Greg's Plugins FAQ.
The introduction of WordPress 2.7 brought with it significant new capabilities for threading and paging comments, but these same changes in WordPress mean that well established methods for numbering comments -- like including a basic incrementing counter within your template code -- no longer do the trick. Fortunately, taking advantage of modern comment handling features like paging and threading doesn't have to mean giving up comment numbering altogether.
However, it does mean that your theme needs specifically to support the new comment features using a special template tag called wp_list_comments(). It also means that if you want to make any modifications to how individual comments are displayed, your theme must define a callback function to handle the display of individual comments, and that callback function must be referenced by the wp_list_comments() template tag. For better or worse, that is how WordPress works as of this writing: advanced comment functionality requires wp_list_comments(), and overriding the built-in routines for displaying an individual comment requires a callback function.
In other words, this is not a plugin feature, it is a WordPress feature. It's crucial to understand this before trying to set up this plugin to work with your blog.
So, having said all that, what's the fastest (and least flexible) way to get your comments numbered?
Replace wp_list_comments() in your theme's comments.php file with wp_list_comments('callback=gtcn_basic_callback').
Please note, however, that using this basic callback function included with the plugin as-is, without any modifications to match your own theme structure, will mean the styling of your comments will almost certainly change. Why? Because taking advantage of all the new comment features introduced in WordPress 2.7 requires the use of a callback function (have you heard this before?), and replacing the one you have with the bundled basic callback function -- or adding one where there wasn't one before -- means replacing whatever existing structure and style you already have in place.
This fact is 1) unavoidable and 2) straightforward to overcome. It is unavoidable because this is how WordPress handles comments as of version 2.7 and later. It is straightforward to overcome because anyone can create their own callback function, as detailed under 'Advanced Usage'.
Please do not contact me to report that using the basic callback function has changed the styling of your blog's comments!
And what's the more involved (but far more flexible) way to get your comments numbered?
Create your own callback function to display comments how you would like them (by modifying the callback function already included in your theme or, if your theme doesn't have one, by using the included basic callback function as a starting point), and insert gtcn_comment_numbering($comment->comment_ID, $args) within the callback function wherever you would like the comment number to appear. For custom styling, the function can also take an optional third parameter which defines the class of the div used to wrap the comment number. The default class is commentnumber. (If you'd rather not have any div wrapper placed around the comment number, you can specify this in the main plugin settings.) Finally, a fourth optional parameter enables you to suppress automatic output of the comment number by passing in 'quiet'. By default, the comment number will be echoed rather than returned.
So, for example, to retrieve the comment number rather than triggering its output, you might use:
$comment_number = gtcn_comment_numbering($comment->comment_ID, $args, $wrapclass, 'quiet')
You might decide to wrap up code like this in a function, and then use add_filter to hook it into an existing theme function for displaying part of the comments, but if you decide to do that, it's essential to provide the value of $args to the wrapper function. Many people have written to me wondering why the wrapper function they've hooked in via add_filter doesn't seem to work, and in virtually all cases, the problem is that relative to the wrapper function, $args is out of scope: the wrapper function has no idea what $args were originally provided to the theme by WordPress, and as a result it simply passes an undefined value to this plugin. Naturally, that doesn't make for very good comment numbering.
The usual place to store your own callback function is in your theme's functions.php file. Just give the function a unique name, and reference it -- rather than the included basic callback function -- when your theme calls wp_list_comments(), like so:
wp_list_comments('callback=my_uniquely_named_callback_function')
The procedure is described in more detail in the WordPress documentation here:
WordPress wp_list_comments documentation
Please note that I am not in a position to provide personal consultation on how best to code or modify a callback function for your own specific WordPress theme.
Please consider asking your theme developer to support this plugin out of the box: with the addition of just a single line of code, most themes can be ready to display hierarchical comment numbering as soon as this plugin is activated!
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY -- without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.