Reverse Order Comments
A really simple WordPress Plugin. It provides the function ro_comments_template() , which allows the comments to be displayed in reverse order (thus the newest comments first, oldest last).
A really simple WordPress Plugin. It provides the function ro_comments_template() , which allows the comments to be displayed in reverse order (thus the newest comments first, oldest last).
- 01Install & activate the plugin.
- 02Edit your theme files and implement the new function as described in the FAQ section.
Frequently asked questions.
How do I implement the plugin function in my templates?
Open the template file which should show the comments in a reverse order in your favorite editor. Locate the line
<?php comments_template(); ?>
and replace it with
<?php if(function_exists('ro_comments_template')) ro_comments_template(); else comments_template(); ?>
Note:
The arguments of the function can be different in your template, for example if it is
<?php comments_template('', true); ?>
change the plugin function accordingly to
What are the files in theme-examples directory?
theme-examples/ default (English default theme) comments-topinput.php comments.php adapted for a guestbook tpl_guestbook.php template for a guestbook
default_de (German default theme) comments-topinput.php comments.php adapted for a guestbook tpl_gaestebuch.php template for a guestbook
Will it work with paged comments?
Yes, but if you use comment navigations with labels like “older” and “newer”, then it might be puzzling for the user, as the comment order is opposite to the navigation. In this case I suggest not to use the plugin in combination with comment-pagination or you should change your navigation labels.
Building a guestbook for the Kubrik theme
Precondition: comments-topinput.php and tpl_gaestebuch.php are in in your template directory.