[theme-reviewers] Numbering comments with wp_list_comments()
Syahir Hakim
khairulsyahir at gmail.com
Sun Jan 2 03:53:24 UTC 2011
Daniel,
That works as well for non-paginated comments. Is there any way to keep
the correct numbering increments when the comments are paginated? e.g.
there's 5 comments per page and so the comments on first page are
numbered 1 - 5, and the second page are numbered 6 - 10 etc. Also it
seems that Wordpress treats threaded comments as 1 comment, so we can't
exactly use (comment page number x comments per page) as well.
--
Regards,
Syahir Hakim
Contact:
http://www.khairul-syahir.com
+6014 753 1883
On 2/1/2011 11:26 AM, Daniel Tara wrote:
>
> Chip, I think he means keeping a counting the outputted comments
> inside a variable.
>
> Just an idea, untested:
>
> Initialize a variable right before the wp_list_comments() function,
> like this:
>
> $i = 0;
>
> wp_list_comments();
>
> and then you declare $i as global in graphene_comment() and increase
> it on every iteration:
>
> function graphene_comment() {
>
> global $i;
>
> $i++
>
> // comments callback
>
> }
>
> Daniel
>
> *From:*theme-reviewers-bounces at lists.wordpress.org
> [mailto:theme-reviewers-bounces at lists.wordpress.org] *On Behalf Of
> *Chip Bennett
> *Sent:* Sunday, January 02, 2011 5:20 AM
> *To:* theme-reviewers at lists.wordpress.org
> *Subject:* Re: [theme-reviewers] Numbering comments with
> wp_list_comments()
>
> Have you tried outputting wp_list_comments() inside of OL tags, and
> styling the list marker?
>
> On Sat, Jan 1, 2011 at 9:08 PM, Syahir Hakim <khairulsyahir at gmail.com
> <mailto:khairulsyahir at gmail.com>> wrote:
>
> Hi everyone,
>
> One of my theme users is trying to figure out how to number the
> comments shown in the website. In the old days (prior to
> wp_list_comments() being a requirement) this can be easily done using
> a counter variable ( $i = 0, $i++ that sort of thing), but can the
> same effect be achieved when using wp_list_comments()?
>
> I know we can just style the list output, but that's not very flexible
> in terms of styling. You can't really move the ordered list numbers
> around as you wish, for example.
>
> FYI, my theme (Graphene) is using wp_list_comments() with a callback
> function graphene_comment() to format the comments output.
>
> Thanks guys!
>
> --
> Regards,
> Syahir Hakim
>
> Contact:
> http://www.khairul-syahir.com
> +6014 753 1883
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> <mailto:theme-reviewers at lists.wordpress.org>
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
More information about the theme-reviewers
mailing list