updated   : May 15, 2012
we now have 588 snippets
category comment
By : , on January 06, 2012 9:00 am

Display user with the most comments with count, email, author url

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you display the top commenter list of users. Use $result->comment_author_email, $result->comments_count, $result->comment_author_url, to add additional parameters to this snippet.

read more
By : , on November 28, 2011 9:00 am

Display the comment count using a shortcode

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you display the comment count for any post by simply using this shortcode [comments id="23" ] replacing the ID with the post ID you want to display the count for.

read more
By : , on September 13, 2011 9:00 am

Redirect commenter to thank you post or page

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will redirect a commenter to any post or page you specify. Consider redirecting a commenter to a thank you page when they comment on a post.

read more
By : , on September 10, 2011 9:00 am

Display last months most commented posts as thumbnail

wordpress snippet

This snippet will display last months most commented posts as thumbnails. Add the first snippet to the functions.php of your wordpress theme then add the second snippet where you wish to display the thumbnails. I currently use this snippet on http://wpsnipp.com after the third post if you wanted to see it in action.

read more
By : , on August 21, 2011 9:00 am

Remove recent comments wp_head CSS

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove the CSS added to the header for the recent comments widget.

read more
By : , on August 19, 2011 9:00 am

Highlight comments using #comment-hash and jquery

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add class=”highlight” to a comment when visiting a comment URL eg: wpsnipp.com/category/post/#comment-12 Don’t forget to create some css for the highlight class!

read more
By : , on May 07, 2011 9:00 am

Count parent comments and replies separately

wordpress snippet

This snippet will count parent comments and replies separately. Add the first snippet to the functions.php of your wordpress theme then add the second snippet in the single.php or the theme you will to display the number of comments and comment replies.

read more
By : , on April 20, 2011 9:00 am

Add shortcode support to comments

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will enable shortcodes for comments. This code will first remove all shortcodes when it gets to comments and reinitialize only the shortcodes listed within init_common_shortcodes function. I have added in a simple sample shortcode that will grab the users website url and replace the [mysite] shortcode.

read more