WordPress Plugin: Sexy Comments

Unhappy with my theme’s comment display, I recently re-coded a sexier comment display as a plugin so others can sexify their comments as well.

Download the plugin.

Features

  • Forum-thread-like comment layout: User information to the left, comment to the right.
  • Author post highlighting
  • Altered Trackback/Pingback Display Formating
  • Avatars
    • Either display/hide avatars
    • Select your avatar service of choice (Gravatar is the only option until I find more avatar services)
    • Specify maximum avatar dimension
    • Customize default/trackback avatars
  • “Number of Comments” Message Customization
  • CSS Overriding

Installation

  1. Download and unzip the sexycomments.zip
  2. Place sexycomments folder in your wp-content/plugins directory
  3. Log in to your WordPress admin panel and activate the plugin, then visit the SexyComments submenu of the plugins tab.
  4. Customize the settings until you have something that works for you.
  5. Locate the template file(s) in your theme that loops over and displays comments. Remove that comment output loop and replace with:
    < ?php sexycomments_print($comments); ?>  
    

    NOTE: Be sure not to touch the section that generates the form for adding comments! This plugin does not re-create the comment creation form.

  6. Lastly, consider disabling the plugin CSS and taking the example CSS provided and customize it to suit your theme’s color scheme.
  7. You should be all set, now! w00t w00t! Go make a Gravatar account if you don’t already have one and upload an avatar.

Comments

92 responses to “WordPress Plugin: Sexy Comments”

  1. Yay. This is an example of the display of Sexy Comments.

  2. I like it, but you know what you need to program now….A Sexy Party (cue Stewie’s Sexy Party Music – Family Guy)

  3. […] proud to be the first to test out Matt’s new Sexy Comments plugin. Since the comments on a few of my stories have taken on feel similar to that of a discussion […]

  4. […] response to Matt’s new plugin, it made me think of Family Guy and I just had to post this mix that I found online. […]

  5. I’m not consistently getting the gravatars to render… Thoughts?

  6. @Zach

    The problem, sadly, falls with Gravatar and their service. It seems to be a little unreliable at times. The next version of SexyComments will cache the avatars. I’ll be working on that over the next week.

  7. Nice plugin Matt. Will be building support for this plugin into my Unwakeable wordpress theme.

  8. Hi
    Im trying to get this plugin working on my blog but being new to wordpress cant find the code in my theme to edit. I am using the default theme which seems to be based on the kubrick theme. Any help on the code i need to edit to display this plugin

    Thanks in advance
    Dave

  9. @Dave

    Sure. In Kubrick (and most themes), the file you want to edit is comments.php. Find the section that looks like:


    < ?php if ($comments) : ?>
    <h3 id="comments">< ?php comments_number('No Responses', 'One Response', '% Responses' );?> to “< ?php the_title(); ?>”</h3>

    <ol class="commentlist">

    < ?php foreach ($comments as $comment) : ?>

    <li class="<?php echo $oddcomment; ?>" id="comment-< ?php comment_ID() ?>">
    <cite>< ?php comment_author_link() ?></cite> Says:
    < ?php if ($comment->comment_approved == '0') : ?>
    <em>Your comment is awaiting moderation.</em>
    < ?php endif; ?>
    <br />

    <small class="commentmetadata"><a href="#comment-<?php comment_ID() ? rel="nofollow">" title="">< ?php comment_date('F jS, Y') ?> at < ?php comment_time() ?></a> < ?php edit_comment_link('e','',''); ?></small>

    < ?php comment_text() ?>

    </li>

    < ?php /* Changes every other comment to a different class */
    if ('alt' == $oddcomment) $oddcomment = '';
    else $oddcomment = 'alt';
    ?>

    < ?php endforeach; /* end for each comment */ ?>

    </ol>

    < ?php else : // this is displayed if there are no comments so far ?>

    < ?php if ('open' == $post->comment_status) : ?>
    <!-- If comments are open, but there are no comments. -->

    < ?php else : // comments are closed ?>
    <!-- If comments are closed. -->
    <p class="nocomments">Comments are closed.</p>

    < ?php endif; ?>
    < ?php endif; ?>

    Remove that and replace it with the sexycomments function call. I would suggest making saving a copy of comments.php prior to deleting the code, however.

  10. thanks for that it worked perfectly also will i have to edit comments-popup.php aswell or will just comments.php do it aswell

  11. Hi Matt,

    Is there any way to get long URLs to break rather than extend thru the columns? Someone left a long URL on a comment to one of my posts and it hangs out past the column width. Mostly asthetic but figured I’d ask.

    URL: http://www.whitemountaintech.net/wordpress/2007/04/11/pbwiki-yackpack-voice-enabled-wiki/

    John

  12. @Dave

    No, comments-popup.php can remain as-is.

    @John

    Oooo, good catch. I’ll see what I can do with that :D

  13. Urm I replaced the code as shown above with the sexy comments and it hasn’t made any difference to my comments. I have activated it in the plugins.

    Help….

    Many Thanks,

    Fi

  14. @fionaheartist

    I know this is an odd question to ask…but…Are you sure you replaced the code in the appropriate theme? (I’ve been prone to editing the wrong theme from time to time). Do you have a page with comments that I can see?

  15. just upgraded my WP and i’m wondering where I should replace the code for

    sexy comments

    looks very cool.

    is it just in comments.php

    ?

  16. Very cool plugin for wordpress

  17. Sexy! I like the name. I gave ‘er a go with poor results, then coming back here I think I see light at the end of the tunnel. I’ll install it at HQ Cod so would somebody come over and leave me a comment as test?

  18. @Jackson

    Yeah, do the code replace in your comments.php file

    @Flash Buddy

    It appears you have removed your reply box so I can’t add a comment to your stories :(

  19. […] Gravatars2: وهي نسخة معدلة ومطورة من الإضافة الأصلية. Sexy Comments: وهي إضافة متقدمة تقوم بإستبدال نظام التعليقات كلية […]

  20. Hi matt
    im currently using the pool theme and am having a bit of trouble finding what part to delete from the comments theme file
    could you give me a hand?
    it seems quite different from the code you have posted before

  21. Hey when im using your sexy comments it wont show up my gravatar even though i have enabled the avatar support and i have a gravatar account could it be gravatar or my site or you script?

  22. Don’t worry its working now i dont no what happened

  23. The plugin seems to be working great aside from one problem.

    The only gravatar that seems to be showing is my own. All of the gravatars from other peoples comments are now just the grey shadow man.

    Any ideas as to what is going on?

  24. And apparently, my gravatar isn’t showing up in your comment section..?

  25. Also, I got this error when activating the plugin.

    I think I will switch back to what I had until I can get help figuring this out… ?

    The Sexy Comments plugin is now initialized.

    Warning: Cannot modify header information – headers already sent by (output started at —/html/wp-content/plugins/sexycomments/sexycomments.php:169) in —/html/wp-includes/pluggable.php on line 275

  26. Just wondering if you could incorporate mybloglog.com avatars into this plugin?

    They are used a lot more than gravatar.

    This plugin uses them, if it is of any help to you….

    http://www.napolux.com/2006/12/14/myavatars-a-wordpress-plugin-for-mybloglog/

    That is currently the plugin that I use to get avatars, but I like the layout of yours much better. I would love to see the mybloglog avatars integrated. :)

  27. One question, where do I find the comment output loop, so I can replace it? I’m still a little new to WP, so I am still learing….LOVE the plug-in BTW.

  28. Very sexiful! ;-)

  29. Oooh, I think I just did it – a bit of trial and error, but it seems to work great. Fantastic plugin Matt, thanks.

  30. Sexy Comments are turning up in my comments, but in a super-small font. Suggestions for what to do?

  31. antis3ptick Avatar
    antis3ptick

    hello thanks good job, but i want to list trackback between comments can i disable trackbacks?

  32. Cool plugin. Thanks. :)
    -Nish

  33. does this work with mybloglog avatar?

  34. thanks very much for this plugin matt. even though i’m not an coding-crack i managed to replace the code as needed and made a few cheanges to the appearance. but one problem is left: the font-size of the normal text is a bit small and i’m not sure how to make it bigger.
    do i have to create a new div-tag with an font-size 1em for the normal text?

  35. hey i got it to work but i have both gravatar and mybloglog avatr running at the same time. could you tweek it and have two versions. for mybloglog and one for gravatar. i just added the code to your php and it shows but so does yours. let me know

  36. It’d be nice if this plugin added a spot for users to have an uploaded avatar under their profile without having to sign up for the Gravatar service. I want sexy comments but without the middleman.

  37. What’s up? Just testing to see if my Gravater is working. It hasn’t been working on my site….

  38. Can anyone help me? My Gravater isn’t working on my site. I’m positive I set it up right….any suggestions?

  39. When I try to activate this plugin i get the stupid “Plugin could not be activated because it triggered a fatal error.”

    Does anyone know how to get around this?

  40. Gravatar isn’t working for me. Anyone else?

    Help?

  41. My gravatar is not working on my site and in a minute I will see if it working on yours.

    Am I missing something?

  42. Hi, is Sexy Comments compatible with WP 2.2.1? Getting the “Plugin could not be activated because it triggered a fatal error.” message. BTW, I’m using WAMP on my local machine as a test site whilst I get a VPS set up.

    If anyone knows of a way to dump the error logs to see what’s happening, I’d be glad to post them up.

  43. […] here….not one single WordPress plug-in that I have attempted to use has worked. I tried the SexyComments that Heather is using on her site – which actually works partially if I want two sets of […]

  44. Disregard my ping above – I got it ;-)

  45. prodigal Avatar
    prodigal

    awesome plugin , pitty that gravatar isent working :\

  46. rootherb Avatar
    rootherb

    Gravatars are not working for me too

  47. Terence Avatar
    Terence

    Hi, is it possible to use my own webspace to store all the avatars instead of using gravatar. Would like to see that in the next version =)

  48. Comments text on the right column does not show on the Page section. ANy solution?

  49. I downloaded and installed Sexy Comments 1.4 from wordpress.org, however when I click on the settings for Sexy Comments nothing shows up except the word ‘Settings’, in other words, none of the settings show up. I can’t find another version of 1.4 to download anywhere, so I’m not sure if this is a bug in the file that WordPress.org has or if it’s something that’s known.

    Any ideas?