How To Reverse The WordPress Comment Order To Show The Latest On Top

Tutorials

Check out this handy little hack that basically reverses your comment order to show the latest ones on top. This way you don't have to scroll all the way to the bottom to find read the most recent comments.

Reverse The WordPress Comment Order To Show The Latest On Top

Here’s a handy little hack that I found over at iwebsource.net. It basically reverses your comment order to show the latest ones on top. This way you don’t have to scroll all the way to the bottom to find read the most recent comments.

Add this to your theme’s functions.php file:

{code type=php}if (!function_exists('iweb_reverse_comments')) {
function iweb_reverse_comments($comments) {
return array_reverse($comments);
}
}
add_filter ('comments_array', 'iweb_reverse_comments');

I tested this hack on the WordPress 3.1 and it works as advertised.

It’s very useful if you have posts that get pages and pages worth of comments.

All the good WordPress stuff, once every two weeks

Subscribe

Leave a comment