[wp-hackers] Replies count

Mike Schinkel mikeschinkel at newclarity.net
Thu Sep 23 21:32:27 UTC 2010


Hi Ashish:

Here's a function called get_comment_replies() that will probably provide what you need:

http://gist.github.com/594346

Pass it the comment ID and it will return a comment object annotated with "reply_count" and "replies" properties where the reply_count is the count of all replies and sub-replies, and replies is an array of objects that have been similarly annotated, recursively. Note it may or may not handle thousands of comments on a post, but since I don't have anything like that to test with I can't be sure.

Hope this helps.

-Mike


On Sep 23, 2010, at 3:25 PM, Ashish Saini wrote:

> Now I even need to list them as
> - 1
> -- 1.1
> --- 1.2
> - 2
> - 3
> 
> Any ideas about this?
> 
> Thanks & Regards
> Ashish Saini aka Ashfame
> (Deserve Before You Desire)
> Homepage : http://www.ashfame.com | Blog : http://blog.ashfame.com | Twitter
> : http://twitter.com/ashfame
> 
> 
> On Thu, Sep 23, 2010 at 5:53 PM, scribu <mail at scribu.net> wrote:
> 
>> On Thu, Sep 23, 2010 at 12:55 PM, Ashish Saini <
>> ashishsainiashfame at gmail.com
>>> wrote:
>> 
>>> Hello everyone,
>>> 
>>> I was wondering what would be an easy solution to achieve the number of
>>> replies a comment has get in a threaded comment.
>>> Is that something I can do in the comments callback function or something
>> I
>>> would need to do by jquery by counting the li's in the children class
>>> inside
>>> it.
>>> 
>> 
>> If you want an easy way, I would go with the jQuery method.
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> _______________________________________________
> 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