wordpress snippets last updated   : January 29, 2015
we now have 646 snippets

Customize Comment Count Text

wordpress snippet

You can customize the text for displaying the number of comments inside the loop. This is just a simple template edit however it is extremely useful if you are creating a theme that is not a traditional theme or you wanted to inject a little bit of personality into the site.

read more

Redirect commenter to thank you post or page

wordpress snippet

Why not thank your visitors! Let them know they are important by redirecting them to a thank you page where you can display a great big thank you for commenting on my wordpress site message. Adding this snippet to the functions.php of your wordpress theme will redirect a commenter to any post or page you specify. To update the snippet to a page change wp_redirect('/page/'); replace /page/ with whatever page you would like eg: wp_redirect('/thank-you/');.

read more

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

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

Display user comment count next to username

wordpress snippet

Add the first snippet into the functions.php of your wordpress theme. Open up your comments.php template and place the second snippet commentCount() in the location you wish to display each users comment count.

read more

Replace admin and user comment class

wordpress snippet

Wordpress creates a class name for your comments using your username and for security reasons you may wish to change them. Adding this snippet to the functions.php of your wordpress theme will remove and replace the admin and user class names within your comments.

read more