[wp-hackers] How to number the paged comments in theme Was: Tutorial for custom Walker_Comment ?

William Canino william.canino at googlemail.com
Thu Nov 5 23:11:29 UTC 2009


>> It accepts echo=false without any problem.

Yes it does. However, I may end up using ( get_comment_pages_count() >
1 ) as it is more good-looking.  That leaves me with the other
quandary:

> 1. My theme has no nested comments, but uses <ol> instead of <ul>
>
> How do I number the paged comments (<ol start="?"> to maintain comment
> numbering. For example, if I chose 10 comments per page, the comments
> at page two will start at 11. How do I get that 11?

Do you think

<ol start="<?php echo ( get_query_var('cpage') - 1 ) *
get_query_var('comments_per_page') + 1 ?>">

is okay and wouldn't cause problems or fail later?

I am just being careful about these undocumented functions.


2009/11/5 Mike Little <mike at zed1.com>:
> 2009/11/5 Andrew Nacin <anacin at gwhatchet.com>
>
>> >
>> > I don't believe that will work: the default comment_walker *always*
>> echoes.
>> >
>>
>> #10948 is for wp_list_comments()... paginate_comments_links() only relies
>> on
>> the walker to determine the number of pages required (and even then only
>> when threading is on, otherwise it uses $wp_query).  It accepts echo=false
>> without any problem.
>>
>>
> Doh! That's what I get for not reading things properly, thanks for
> clarifying that.
>
> Mike
> --
> Mike Little
> http://zed1.com/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list