Title: Comment Leader Hack
Last modified: August 18, 2016

---

# Comment Leader Hack

 *  Resolved doniboy
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/)
 * Not real familiar with WP yet, so alert me of any problems.
    **Download** [wp_comment_leaders](http://www.verbalexpressions.com/ws_cl.php)**
   Tag** `<?php get_comment_leaders(); ?>` **Arguments Definition:**
    1. A number that limits the amount of records that are to be shown. (default’s ‘
       5’)
    2. A string that excludes certain names from appearing in the list. Separate multiple
       names with a comma.
    3. A number: pads the visitor’s total comment count with zeros.
    4. A string to display before the record.
    5.  A string to display after the record. (default is a line break ‘
       ‘)
    6. **Example**
        `<?php get_comment_leaders( 10, "admin_name, spammer_name", 3, '`
    7. ', '
    8. '); ?>

Viewing 15 replies - 1 through 15 (of 39 total)

1 [2](https://wordpress.org/support/topic/comment-leader-hack/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/comment-leader-hack/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/comment-leader-hack/page/2/?output_format=md)

 *  [Orbit Juice](https://wordpress.org/support/users/orbitjuice/)
 * (@orbitjuice)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33415)
 * Sweet script. Good work.
    I tweaked it a little to the output format I wanted.
   You can see it here: [http://www.orbitjuice.com](http://www.orbitjuice.com)
 *  [Orbit Juice](https://wordpress.org/support/users/orbitjuice/)
 * (@orbitjuice)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33418)
 * Also… I edited the code for multiple and single comments.
    i.e.: Eric left 15
   comments Will left 8 comments John left 2 comments Mary left 1 comment
 *  Thread Starter Anonymous
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33425)
 * thanks 🙂
 *  Thread Starter Anonymous
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33429)
 * Yea I liked what you did so I changed it to look similar to yours… also made 
   it so that it recognizes single and multiple, comments.also. Thanks
    1. A number that limits the amount of records that are to be shown. (default’s ‘
       5’)
    2. A string that excludes certain names from appearing in the list. Separate multiple
       names with a comma.
    3. A string to display before the record.
    4. A string to display between the record. (default “-“)
    5. A string to display after the record. (default is a line break ‘
       ‘)
 *  Example
    <?php get_comment_leaders( 10, “admin_name, spammer_name”, ‘
    - ‘, ‘posted’, ‘
    - ‘); ?>
 *  [Orbit Juice](https://wordpress.org/support/users/orbitjuice/)
 * (@orbitjuice)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33430)
 * Here is mine. It’s a little different. It changes on the output.
    if ($author_comment_count!
   = 1) { echo “$before$comment_author_link – **$author_comment_count** comments
   $after”; } else { echo “$before$comment_author_link – **$author_comment_count**
   comment$after”; }
 *  [southerngal](https://wordpress.org/support/users/southerngal/)
 * (@southerngal)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33433)
 * Thanks for this…another thing to play with. 😉
 *  [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33884)
 * I love this hack. I would like to make som modifications to it, but I’m unsure
   how. I’d like my output to look like this:
    Jess – 184 total last commented: (
   date of last comment) on entry: (entry title last commented on w/link to entry)
   Is there a way to do this?
 *  [Nick Momrik](https://wordpress.org/support/users/mtdewvirus/)
 * (@mtdewvirus)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33885)
 * The portion of the function that figures the last comment by an author doesn’t
   work. I was going to try to fix the query, but it’s not an easy one.
 *  [Hamoudy](https://wordpress.org/support/users/hamoudy/)
 * (@hamoudy)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33886)
 * Yeah I was having the same problem too. With the “Last” section.
 *  [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33887)
 * MtDew, do you write all the hacks around here? 😉 Or just know everything? ‘Cuz
   you are all over the board helping everyone. What a guy! =)
    Thanks for all your
   help!
 *  [Nick Momrik](https://wordpress.org/support/users/mtdewvirus/)
 * (@mtdewvirus)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33888)
 * I just try to help out as much as I can. 🙂
 *  Thread Starter Anonymous
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33889)
 * Daisyhead yes you can i’ll post how to do it in a sec when I figure out whats
   going on….. MtDewVirus, What exactly isn’t working correctly? I don’t see the
   problem that you are talking about.
 *  [Nick Momrik](https://wordpress.org/support/users/mtdewvirus/)
 * (@mtdewvirus)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33890)
 * The query doesn’t exactly pull the ID and comment_ID for the last comment by 
   a visitor. At least not from my testing of it. The GROUP BY messes this up. I
   ran into a similar problem with a hack I wrote and was able to fix it by callin
   for MAX(comment_ID), but then how do you get the correct ID? You can’t pull the
   MAX(ID) because the latest post commented on by a visitor may not be their latest
   comment. See what I mean?
    I was running the query through phpMyAdmin, trying
   to get the correct results but so far have been unable to.
 *  [daisyhead](https://wordpress.org/support/users/daisyhead/)
 * (@daisyhead)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33894)
 * You guys are great! I can live without the last date commented. I don’t mean 
   to be such a pest. Maybe I just need to tweak my output so it will say:
    Jess–
   184 total last on entry: (entry title last commented on w/link to entry) Is there
   a way to change that?
 *  [Hamoudy](https://wordpress.org/support/users/hamoudy/)
 * (@hamoudy)
 * [22 years, 4 months ago](https://wordpress.org/support/topic/comment-leader-hack/#post-33901)
 * Hey Daisyhead
    Does the “Last” at the end of your comments leader actually works?
   and bring up the latest comment by that user?

Viewing 15 replies - 1 through 15 (of 39 total)

1 [2](https://wordpress.org/support/topic/comment-leader-hack/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/comment-leader-hack/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/comment-leader-hack/page/2/?output_format=md)

The topic ‘Comment Leader Hack’ is closed to new replies.

 * 39 replies
 * 12 participants
 * Last reply from: Anonymous
 * Last activity: [21 years, 11 months ago](https://wordpress.org/support/topic/comment-leader-hack/page/3/#post-34068)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
