10 Handy WordPress Comments Hacks

Advertisement

Comments sections are neglected on many blogs. That is definitely a bad thing, because comments represent interaction between you and your readers. In this article, we’ll have a look at 10 great tips and hacks to enhance your blog’s comments section and give it the quality it deserves.

You may be interested in the following related posts:

1. Add Action Links To Comments

Screenshot

The problem.
Whether or not you allow readers to add comments without having to be approved, you will often need to edit, delete or mark certain comments as spam. By default, WordPress shows the “Edit” link on comments (using the edit_comment_link() function) but not “Delete” or “Spam” links. Let’s add them.

The solution.
First, we have to create a function. Paste the code below in your functions.php file:

function delete_comment_link($id) {
  if (current_user_can('edit_post')) {
    echo '| <a href="'.admin_url("comment.php?action=cdc&c=$id").'">del</a> ';
    echo '| <a href="'.admin_url("comment.php?action=cdc&dt=spam&c=$id").'">spam</a>';
  }
}

Once you have saved functions.php, open up your comments.php file, and add the following code where you want the “Delete” and “Spam” links to appear. They must go in the comment loop. In most themes, you’ll find an edit_comment_link() declaration. Add the code in just after that.

delete_comment_link(get_comment_ID());

Code explanation.
The first thing we did, of course, was to make sure the current user has permission to edit comments. If so, links to delete and mark a comment as spam are displayed. Note the use of the admin_url() function, which allows you to retrieve your blog admin’s URL.

Source:

2. Separate TrackBacks From Comments

Screenshot

The problem.
Do your posts have a lot of TrackBacks? Mine do. Trackbacks are cool because they allow your readers to see which articles from other blogs relate to yours. But the more TrackBacks you have, the harder the discussion is to follow. Separating comments from TrackBacks, then, is definitely something to consider, especially if you do not use the “Reply” capabilities introduced in WordPress 2.7.

The solution.
Open and edit the comments.php file in your theme. Find the comment loop, which looks like the following:

foreach ($comments as $comment) : ?>
    // Comments are displayed here
endforeach;

Once you have that, replace it with the code below:

<ul class="commentlist">
    <?php //Displays comments only
  foreach ($comments as $comment) : ?>
        <?php $comment_type = get_comment_type(); ?>
        <?php if($comment_type == 'comment') { ?>
      <li>//Comment code goes here</li>
  <?php }
    endforeach;
</ul>

<ul>
    <?php //Displays trackbacks only
  foreach ($comments as $comment) : ?>
        <?php $comment_type = get_comment_type(); ?>
        <?php if($comment_type != 'comment') { ?>
      <li><?php comment_author_link() ?></li>
  <?php }
    endforeach;

</ul>

Code explanation.
Nothing hard about this code. The get_comment_type() function tells you if something is a regular comment or a TrackBack. We simply have to create two HTML lists, filling the first with regular comments and the second with TrackBacks.

Source:

3. Get Rid Of HTML Links In Comments

Screenshot

The problem.
Bloggers are always looking to promote their blogs, and spammers are everywhere. One thing that totally annoys me on my blogs is the incredible amount of links left in comments, which are usually irrelevant. By default, WordPress transforms URLs in comments to links. Thankfully, if you’re as tired of comment links as I am, this can be overwritten.

The solution.
Simply open your function.php file and paste in this code:

function plc_comment_post( $incoming_comment ) {
  $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);
  $incoming_comment['comment_content'] = str_replace( "'", '&apos;', $incoming_comment['comment_content'] );
  return( $incoming_comment );
}

function plc_comment_display( $comment_to_display ) {
  $comment_to_display = str_replace( '&apos;', "'", $comment_to_display );
  return $comment_to_display;
}

add_filter('preprocess_comment', 'plc_comment_post', '', 1);
add_filter('comment_text', 'plc_comment_display', '', 1);
add_filter('comment_text_rss', 'plc_comment_display', '', 1);
add_filter('comment_excerpt', 'plc_comment_display', '', 1);

Once you have saved the file, say goodbye to links and other undesirable HTML in your comments.

Code explanation.
The first thing we did was create two functions that replace HTML characters with HTML entities. Then, using the powerful add_filter() WordPress function, we hooked the standard WordPress comments processing functions to the two functions we just created. This makes sure that any comments added will have their HTML filtered out.

Sources:

4. Use Twitter Avatars In Comments

Screenshot

The problem.
Bloggers find Twitter very useful because it allows them to promote their blog and stay connected to other bloggers and their own audience. Because of Twitter’s popularity, why not illustrate comments with Twitter avatars instead of the normal gravatars?

The solution.

  1. The first thing to do is get the functions file here12.
  2. Once you have that, unzip the archive to your hard drive, and then open the twittar.php file.
  3. Select all of its content and paste it to your blog’s functions.php file.
  4. The last thing to do is open your comments.php file and find the comments loop.
  5. Paste the following line in the comments loop:
    <?php twittar('45', 'default.png', '#e9e9e9', 'twitavatars', 1, 'G'); ?>

Code explanation.
Some months ago here at Smashing Magazine, an awesome plug-in named Twittar was released. Its purpose is to allow you to use Twitter avatars on your WordPress blog. Because of the number of requests I received from WpRecipes.com readers, I decided to turn the plug-in into a hack, for people who prefer hacks to plug-ins.

Of course, you could simply install the plug-in rather than insert its content into your function.php file. It’s up to you.

Sources:

5. Set Apart Author Comments With Style

Screenshot

The problem.
For blog posts that have a lot of comments, finding the author’s comments and responses to reader questions is not always easy, especially if the blog don’t have WordPress 2.7′s threaded comments feature. Happily, it is possible to give author comments a different style so that readers can always quickly find your answers.

The solution.

  1. Open the comments.php file and find the comment loop:
    <?php foreach comment as $comment) { ?>
  2. After that line, paste in the following:
    <?php
    $isByAuthor = false;
    if($comment->comment_author_email == get_the_author_email()) {
    $isByAuthor = true;
    }
    ?>
  3. Once that’s done, find the line of code that represents comments (it may vary depending on your theme):
    <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
  4. Now we have to output the authorcomment class if the comment was made by the author:
    <li class="<?php echo $oddcomment; ?> <?php if($isByAuthor ) {
     echo 'authorcomment';} ?>" id="comment-<?php comment_ID() ?>">
  5. The last thing we do is create a CSS class for author comments. Open the style.css file and insert the code. Replace the example colors with your colors of choice.
    .authorcomment{
      color:#fff;
      font-weight:bold;
      background:#068;
    }

Code explanation.
Basically, this code compares each email address left by a commentator to the author’s email address. If they match, the $isByAuthor is set to true. When comments are displayed on screen, the value of $isByAuthor is checked. If it returns true, then the authorcomment class is added to the container.

It can be done more easily on WordPress 2.7+ by just adding comment_class(); to the comment’s DIV, which automatically adds the class bypostauthor when you’re commenting on your own post (Thanks, Nima!).

Source:

6. Display Total Number Of Comments And Average Number Of Comments Per Post

Screenshot

The problem.
On your blog’s dashboard, WordPress tells you how many total comments your blog has received. Unfortunately, there’s no function for displaying this information publicly. Displaying the total number of comments on your blog and average number of comments per post can be very helpful, especially if you have a page for advertising opportunities.

The solution.

<?php
$count_posts = wp_count_posts();
$posts = $count_posts->publish;

$count_comments = get_comment_count();
$comments  = $count_comments['approved'];

echo "There's a total of ".$comments." comments on my blog, with an average ".round($comments/$posts)." comments per post.";
?>

Code explanation.
Introduced in version 2.5, the wp_count_posts() and get_comment_count() functions allow you to easily retrieve the total number of posts and comments, respectively, on your WordPress blog. To derive the average number of comments per post, we have to do a bit of simple math, using the PHP round() function to make sure we end up with an integer.

Source:

7. Display X Number Of Most Recent Comments

Screenshot

The problem.
By default, WordPress provides a widget that outputs a list of however many of the most recent comments. This is great, but sometimes you want this functionality without a widget.

The solution.
This hack is very simple: just paste this code wherever you need a certain number of the most recent comments to be displayed. Don’t forget to specify the actual number on line 3 (after the LIMIT SQL clause).

<?php
  $pre_HTML ="";
  $post_HTML ="";
  global $wpdb;
  $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,30) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 10";

  $comments = $wpdb->get_results($sql);
  $output = $pre_HTML;
  $output .= "n<ul>";
  foreach ($comments as $comment) {
    $output .= "n<li>".strip_tags($comment->comment_author) .":" . "<a href="" . get_permalink($comment->ID)."#comment-" . $comment->comment_ID . "" title="on ".$comment->post_title . "">" . strip_tags($comment->com_excerpt)."</a></li>";
  }
  $output .= "n</ul>";
  $output .= $post_HTML;
  echo $output;
?>

Code explanation.
As in the last hack, we use the $wpdb object here, too, this time with the get_results() method. Once the comments have been retrieved by the WordPress database, we simply use a for loop to concatenate the comments into an HTML unordered list. The $pre_HTML and $post_HTML variables, initialized at the top of this code, allow you to define which content should go before and after the comments list.

Sources:

8. Easily Prevent Comment Spam

Screenshot

The problem.
Comment spam is such a pain for everyone. Akismet is a good solution, but why not block spammers outright instead of just marking their comments as suspected spam? This code looks for the HTTP referrer (the page where the request comes from) and automatically blocks the comment if the referrer is incorrect or not defined.

The solution.
Paste the following code in your functions.php file:

function check_referrer() {
    if (!isset($_SERVER['HTTP_REFERER']) || $_SERVER['HTTP_REFERER'] == “”) {
        wp_die( __('Please enable referrers in your browser, or, if you're a spammer, bugger off!') );
    }
}

add_action('check_comment_flood', 'check_referrer');

That’s all. Once you’ve saved the file, your blog will have a new level of protection against spam.

Code explanation.
This code automatically rejects any request for comment posting coming from a browser (or, more commonly, a bot) that has no referrer in the request. Checking is done with the PHP $_SERVER[] array. If the referrer is not defined or is incorrect, the wp_die function is called and the script stops its execution.

This function is hooked to WordPress’ check_comment_flood() function. This way, we can be sure that our check_referrer() function is called each time a comment is posted.

Source:

9. Keep WordPress Backwards Compatible With Versions Older Than 2.7

Screenshot

The problem.
Released some months ago, WordPress 2.7 introduced a totally new commenting system, allowing you to thread comments and display them on separate pages. Although this is great, keep in mind if you are creating a theme for a client or for online distribution that many users still haven’t upgraded their installation to version 2.8 or even 2.7. This code allows 2.7+ users to benefit from the new commenting system, while keeping the old system functional for people with older versions.

The solution.
You’ll need two files for this recipe: the first is a WordPress 2.7 compatible comments file called comments.php. The second is a comment template for older WordPress versions called legacy.comments.php. Both of these files go in your theme directory.

Paste this code in your functions.php file.

<?php
add_filter('comments_template', 'legacy_comments');

function legacy_comments($file) {
  if(!function_exists('wp_list_comments')) : // WP 2.7-only check
    $file = TEMPLATEPATH.'/legacy.comments.php';
  endif;
  return $file;
}
?>

Code explanation.
This code creates a function called legacy_comments(), which is hooked to WordPress comments_template function. Each time WordPress calls comments_template(), our legacy_comments() function is executed. If the wp_list_comments() function doesn’t exist, the code automatically loads legacy.comments.php instead of comments.php.

Sources:

10. Display Most Commented Posts From A Certain Period

Screenshot

The problem.
Number of comments is a good way to measure a blog post’s popularity and is a good filter for displaying a list of your most popular posts. Another great idea is to restrict a list of your most popular posts to a particular period, like “Last month’s most popular posts,” for example.

The solution.
Simply paste the following code where you’d like your most commented posts to be displayed. Don’t forget to change the dates values on line 3 according to your needs.

<ul>
<?php
$result = $wpdb->get_results("SELECT comment_count,ID,post_title, post_date FROM $wpdb->posts WHERE post_date BETWEEN '2009-06-01' AND '2009-07-01' ORDER BY comment_count DESC LIMIT 0 , 10");

foreach ($result as $topten) {
    $postid = $topten->ID;
    $title = $topten->post_title;
    $commentcount = $topten->comment_count;
    if ($commentcount != 0) {
    ?>
         <li><a href="<?php echo get_permalink($postid); ?>"><?php echo $title ?></a></li>
    <?php }
}
?>
</ul>

Code explanation.
The first thing we did was send out an SQL query to the WordPress database using the $wpdb object. Once we got the results, we used a simple PHP foreach statement to display the most popular posts from a certain period in an HTML unordered list.

Source:

Related posts

You may be interested in the following related posts:

(al)

Footnotes

  1. 1 http://www.smashingmagazine.com/2009/07/14/5-useful-and-creative-ways-to-use-wordpress-widgets/
  2. 2 http://www.smashingmagazine.com/2009/07/02/power-tips-for-wordpress-template-developers/
  3. 3 http://www.smashingmagazine.com/2009/06/10/10-useful-wordpress-loop-hacks/
  4. 4 http://www.smashingmagazine.com/2009/05/13/10-custom-fields-hacks-for-wordpress/
  5. 5 http://www.smashingmagazine.com/2009/03/04/15-useful-twitter-plugins-and-hacks-for-wordpress/
  6. 6 http://www.smashingmagazine.com/2009/02/02/mastering-wordpress-shortcodes/
  7. 7 http://www.smashingmagazine.com/2009/05/18/100-amazing-free-wordpress-themes-for-2009/
  8. 8 http://www.wprecipes.com/how-to-add-del-and-spam-buttons-to-your-comments
  9. 9 http://www.wprecipes.com/jamie-asked-how-can-i-display-comments-and-trackbacks-separately
  10. 10 http://www.wprecipes.com/how-to-get-rid-of-links-in-your-comments
  11. 11 http://www.theblog.ca/literal-comments
  12. 12 http://www.smashingmagazine.com/2009/01/08/twitter-avatars-in-comments-wordpress-plugin/
  13. 13 http://www.smashingmagazine.com/2009/01/08/twitter-avatars-in-comments-wordpress-plugin/
  14. 14 http://www.wprecipes.com/ho-to-use-twitter-avatars-in-comments
  15. 15 http://aonach.com/chatter/highlight-author-comments-in-wordpress/
  16. 16 http://www.wprecipes.com/how-to-display-your-average-comments-per-posts
  17. 17 http://www.wprecipes.com/how-to-list-most-recent-comments
  18. 18 http://wphacks.com/huge-compilation-of-wordpress-code/
  19. 19 http://yoast.com/
  20. 20 http://justintadlock.com/archives/2008/11/01/making-your-themes-comments-compatible-with-wordpress-27-and-earlier-versions
  21. 21 http://www.wprecipes.com/how-to-make-your-comments-template-compatible-with-wordpress-27-and-older-versions
  22. 22 http://www.wprecipes.com/how-to-display-the-most-commented-posts-of-2008
  23. 23 http://www.smashingmagazine.com/2009/07/14/5-useful-and-creative-ways-to-use-wordpress-widgets/
  24. 24 http://www.smashingmagazine.com/2009/07/02/power-tips-for-wordpress-template-developers/
  25. 25 http://www.smashingmagazine.com/2009/06/10/10-useful-wordpress-loop-hacks/
  26. 26 http://www.smashingmagazine.com/2009/05/13/10-custom-fields-hacks-for-wordpress/
  27. 27 http://www.smashingmagazine.com/2009/03/04/15-useful-twitter-plugins-and-hacks-for-wordpress/
  28. 28 http://www.smashingmagazine.com/2009/02/02/mastering-wordpress-shortcodes/
  29. 29 http://www.smashingmagazine.com/2009/05/18/100-amazing-free-wordpress-themes-for-2009/

↑ Back to topShare on Twitter

This guest post was written by Jean-Baptiste Jung, a 28-year-old blogger from Belgium, who blogs about Web Development on Cats Who Code, about WordPress at WpRecipes and about blogging on Cats Who Blog . You can stay in touch with Jean by following him on Twitter.

Advertising
  1. 1

    wow, first comment
    Thanks a lot!

    1
  2. 2

    Just what I needed

    -1
  3. 3

    Nice Collection of hacks…. Some of them are quite old.. yet effective. Thanks Jean for putting it all together.

    DKumar M.
    @instantshift

    2
  4. 4

    Nice post – amongst all the wordpress articles available on the net, there isn’t nearly enough attention paid to the comments section.

    A well designed, thought out comment section can really add a nice touch.

    -1
  5. 5

    You should at least mention that #5 can be done more easily on WordPress 2.7+ by just adding comment_class(); to the comment’s DIV, which automatically adds the class bypostauthor when you’re commenting on your own post.

    If you know you’re going to be working on 2.7+ it’s just easier to do it that way, and you get a bunch of other classes from comment_class(); that you can also use.

    (SM) Done, thank you!

    2
  6. 6

    yeah thanks i did this before on a Post on some other site can’t remember but it worked on my Blog i had :)

    0
  7. 7

    How about adding a description how to code the “reply” function for old WordPress themes?

    0
  8. 8

    Nice collection.
    Thanks

    0
  9. 9

    Once again some great information that will definitely come in handy…. thanx SM

    1
  10. 10

    Gr8 stuff!!!

    Tnx

    0
  11. 11

    This article makes WordPress closer to me!!

    0
  12. 12

    Such as always, You Smashed us !

    0
  13. 13

    Be careful with hack nr. 8.

    Firewalls and packet filters may block http referrers and desktop users do not necessarily have rights to change that.

    A missing http referrer is IMHO not a good indication for spam.

    1
    • 14

      I agree. I used that ‘trick’ and I lost ton of the comments. It killed a lot of non-spam comments. Some of my readers complained…

      2
    • 15

      Some great tips here. Thanks for sharing! :)

      I was just thinking about the safety/reliabilty of the ’8. Easily Prevent Comment Spam’ tip.
      You answer confirms my concern. Thanks!

      0
  14. 16

    Great thank you! One thing I’d like to add that I think is REALLY important is to allow the commenter a certain amount of time to EDIT or DELETE the comment once it’s been made.

    1
  15. 17

    Nice piece, but I’d just encourage users to consider trying out the Disqus plugin, which takes over the comments system and offers some fabulous modern features such as Facebook and Twitter login, and reblogs from Twitter shown along with the comments. Great stuff.

    0
  16. 18

    I agree with previous comment #14. Additionally, it’s my understanding that checking for referrer in check_comment_flood this way would also block pingbacks and trackbacks, as the same code is used for these.

    0
  17. 19

    Nice, comments are soo underappreciated :)

    0
  18. 20

    One thing that I believe comments need is to separate Questions/Answers from Comments. I am getting tired of reading through 50 comments on a tutorial just to find a fix that the author was to lazy to update the post with. Something along the lines of #2 so you would have a tab for Q&A.

    0
  19. 21

    Can anyone tell me how to get rid of the whole “Comment” section as in, not have anything that says how many comments or “No comments”?
    What do I need to delete in my wp code so that it does not appear in certain pages?
    Thanks a lot.

    0
  20. 22

    Awesome article, with code examples, can’t thank you enough

    0
  21. 23

    #7 is a big NO NO! You see it relies on you sending a referrer from the page to make the comment, which is fine at first. Until you realize that not all browsers send a referrer, and Firefox is notorious for not sending referrers at times, while other plugins and security programs and firewalls can block a browser or client from sending referrers meaning that they won’t be able to comment.

    It will probably stop a lot of spam, but you’ll be stopping legitimate comments as well from people who may not know what referrers are let alone how to enable it in their security program of choice.

    TV Spy

    1
  22. 24

    Wow, so informative. I didn’t know SPAM had so many flavors! :o)

    2
  23. 25

    Thanks a bunch!!

    0
  24. 26

    Thanks for the hacks

    0
  25. 27

    The tuto is as great as it could. I still don’t understand why people are so into WordPress. PHP + HTML is ugly. Talkingf about good practice and showing those snippets are very painful for my eyes.

    Please devellopers, try to use a real platform,, with separation between php and html. there are plenty now…

    0
  26. 28

    #2 can be done much easier using wp_list_comments with callbacks:

    wp_list_comments('type=pings&callback=pingCallback');

    where pingCallback is the name of the function that handles displaying pingbacks/trackbacks, and I have another one for normal comments:

    wp_list_comments('type=comment&callback=commentCallback');

    It’s much better to use that because you can use the comment functions for getting comment info rather than accessing the array directly, which means wordpress will parse the data before the functions return it (e.g. smilies in comments). It also supports nested comments.

    0
  27. 29

    This came in a great time. I’m just redesigning my Blog and I’m making a theme from scratch, I’m yet to do the part of the comments so this just came in the best timing possible. :)

    Thank you Smashing ;)

    0
  28. 30

    Thank you for this article and all your work, Jean-Baptiste :-)
    Helps me a lot, since I am working on a new site right now for which I need a comment section wich lots of features.

    0
  29. 31

    Hey, thanks so much for the tips. I’m STILL looking for a plugin to notify me of the first time someone comments on my blog. Then, I can shoot them an email, thank them, and hopefully get a subscriber. I’m thinking I’m going to have to code it myself (bah! PHP… I prefer Ruby), but oh well…

    0
  30. 32

    Jean-Baptiste Jung

    July 23, 2009 10:22 pm

    @lossy: What platform do you suggest instead of WordPress?

    @all: Thanks for the comments! Glad to read most of you enjoyed this article.

    -1
  31. 33

    Jean-Baptiste Jung

    July 23, 2009 10:25 pm

    @stealth: Open single.php and delete the call to the comments_template(); function. That’s simple as that :)

    0
  32. 34

    @Jean-Baptiste Jung
    Honestly, for a blog i will not advice anything but WordPress. It is mature, popular and have more than plenty of plugins to do almost anything.
    But i’ll not try to personalize it further than what is available, and only for blogs.

    In any other case, i will use MODx. No need to put php in the template, using html as it is. No blackbox, you can put whatever you want in it without any need to hack into the core.

    Silverstripe, Concrete5, Expression Engine or Textpattern are also very good for this matter.

    Less popular than WordPress, they have less plugins available. That’s a shame giving the fact that they are real CMS who work for you and not the other way around.

    0
  33. 35

    @lossy, are you serious? What real platform you suggest that separates html from php: Joomla? Drupal? Smarty?

    The only true way I’m aware of separating html and php is using xsl which none of the major cms’ support to my knowledge. Which means you’re going to have to integrate the two. I’m sick and tired of hearing people whine about how it all needs to be separated when you can’t possibly do so. Until HTML creates a tag called “echo”, anyway. But, whatever, whiners will whine

    0
  34. 36

    Hi! In 10 hack “Display Most Commented Posts From A Certain Period” I am trying to get a custom field from the postmeta table so that I can display an image next to the link title. Help, please.

    0
  35. 37

    @Tim

    In my previous message i did give you hint on modern CMS platform on tend to separate html and code.

    Take a look at MODx and you ‘ll see what i mean when i tell you that code and html are separated. There are big differences between coding with php into the code and html with tags.

    In MODx if i want the comment-count or an id or whatever, in my “chunk” i just put my html code + a tag (placeholder) which connect to the php:

    Comment count -> [+comment-count+]
    Author name -> [+author+]
    Content of the comment -> [+comment-content+]
    Dynamic class or id -> [+myid+] or [+myclass+]

    edit: it is less clear since the code balise don’t seems to work.

    As you see, it is way more convienent than using hook in the html code etc…

    Furthermore, I hate Joomla, all joomla site looks like another Joomla website (well this one is no more the very truth), too hard to realy customize.
    Drupal is far more powerful but still have blackbox.

    Don’t misunderstand, WordPress is good and i’m using it, but the way it interact with code and html is not elegant and that’s why i asked why designers who don’t like to code go on this platform in place of other one less cumbersome for that matter.

    0
  36. 38

    well, some tricks can be simpler. like the author’s comment style customizing.

    0
  37. 39

    Thanks a lot, I solve some of my problems with this post!!!!

    0
  38. 40

    A few tips and tricks that may soon get handy for my blog, thanks ! :)

    0
  39. 41

    Awesome mate ! I’m just coding the comments section for a client…!

    0
  40. 42

    Awesome stuff! Thanks!

    0
  41. 43

    Thanks for the round up

    0
  42. 44

    Could you tell me how to put 1,2,3…. next to the comments?

    Thank you very much.

    0
  43. 45

    Well does this work with every theme because my didn’t work.

    This is a test page I made

    Should it work with my theme or…? I can paste some code here too if I need to I just need some small help

    0
  44. 46

    This is really very useful for wordpress developers.

    0
  45. 47

    Great tips! But… “8. Easily Prevent Comment Spam” has some issues. I mean, it works very well… well too much. For me, the hack was blocking my own pingback and others trackback.

    0
  46. 48

    Great tricks! Thanks a lot

    0
  47. 49

    perfect, i’d always wondered how to highlight author’s comments and now i can do it myself

    0
  48. 50

    Great tips!

    I’m looking for a way to enhance comments by letting me use HTML on them, in the same way we do in posts. I think this could be done verifying if current user is admin (as we do to use special styling), and if it is we remove filters that take HTML out.

    But I can’t find out which filters are extracting HTML from comments, and where they are applied. Do you know where I could find it?

    0
    • 51

      You’d probably have to hack WordPress – it’s inbuilt and not from a theme’s comments PHP!

      0
  49. 52

    In effect, a dual-processor hyper-threaded machine provides four processors and serves as better test system. ,

    0
  50. 53

    i’d always wondered how to highlight author’s comments and now i can do it myself..
    Thanx :))

    0
  51. 54

    Alison Moore Smith

    January 8, 2010 12:29 am

    Very helpful list. Thank you.

    0
  52. 55

    Thanx, great list :)

    0
  53. 56

    it’s great… can anyone help me how to convert youtube videos to mp3?

    0
  54. 57

    HI. Nice post. Do you know how I’d change #7 to exclude the author (me) from the top 5 list. When I reply with my own comments the widget in the sidebar shows all my comments – not really what I want to show.

    Thanks for the help,
    David

    0
  55. 58

    # 5 rocks! thanks for the incite!

    0
  56. 59

    How did you meet your husband/wife?

    0
  57. 60

    How do you want to be remembered?

    0
  58. 61

    thanks for share, well done

    0
  59. 62

    great tips! thanks for sharing. I have a problem with wp comments in my blog. Anyone can help? (www.gfrendz.com)
    i can write and then in the wordpress user panel approve and view any comments made, but they cannot be displayed in the post, what is the problem?

    0
  60. 63

    Thanks for sharing , it was really helpful

    0
  61. 64

    Jornal do Whisky

    August 9, 2010 12:37 pm

    Great tricks for my next (and better) blog. Tks!

    0
  62. 65

    So, just curious but is there any way to post links in sites that may have links disabled? Just wondering if adding in comments or escaping your html may be able to bypass that trick.

    0
  63. 66

    Perfect! Just what i was looking for!

    0
  64. 67

    anyone knows how to show the number of comments for every user.

    ex:

    test (23 comments) said:
    123

    test2 (12 comments) said:
    etc

    0
  65. 68

    I have never spend time in facebook and twitter. I admit that, social media is now the only possible way to drive traffic. I will surely think seriously about social marketing.

    0
  66. 69

    Orassumduebradeedtere

    January 5, 2011 8:32 am

    Seeing that i have been seeking for some time to have a professional view relating to this specific matter . Seeking in Yahoo I ultimately revealed this site. Looking at this info I am grateful to say that I get a positive feeling I located the very things I needed. I most certainly will make sure to dont forget this website and check it out on a constant basis.

    0
  67. 70

    Hi,
    Is there any hack to separate the comment form from the comments list. i.e. I want to replace the comment form into the sidebar, but the comment list to the usual place.

    0
  68. 71

    Brilliant article!

    0
  69. 72

    It’s much better to use that because you can use the comment functions for getting comment info rather than accessing the array directly, which means wordpress will parse the data before the functions return it (e.g. smilies in comments). It also supports nested comments.
    ECigarette Pakistan

    0
  70. 73

    Awesome post this is. Thanks alot

    0
  71. 74

    Hack number 8 does not work.
    Do not, I repeat do NOT use hack 8 by copy and pasting into your wordpress!
    It will make your website haywire. I’m not sure why it is causing this.
    But I have removed that code from my functions.php

    0
  72. 75

    Credit you – this is sheerest sympathetic !

    0
  73. 76

    Hey great post. I have a question, even though you have great information how can you be sure about all this?

    0
  74. 77

    I have been searching high and low for the answer to this question and i really hope someone can point me in the right direction.

    I run a blog that has several authors/contributors and there are three administrators to the blog including myself. The authors of the blogs automatically receive an email every time one of the administrators approves a comment that is made on their blog post. But what we are trying to find out is how we can stop these emails going to the author. We would prefer to communicate to the author ourselves asking them to reply to the commenter, or sometimes we would reply ourselves as the website admins.

    So do you know how i can stop the automatic emails being sent to authors when comments are made on our wordpress blog?

    Cheers

    0
  75. 78

    Great list of plugins. SPAM is an ever rising issue that us developers need to combat.

    0
  76. 79

    Thank you, thank you, thank you! You made my day. :)

    1
  77. 80

    Hi.

    I’ve just been reading (Set Apart Author Comments With Style) article. I’am using a child theme on my site, how do I go about finding and adding the code to the comment.php file.

    thanks

    dean

    0
  78. 81

    hi, i need a beautiful, eye-catching style for the comments on my forum,
    just the style, not any programming code, any suggestion??

    1

↑ Back to top