开发者 | TimZ |
---|---|
更新时间 | 2012年7月17日 02:47 |
捐献地址: | 去捐款 |
PHP版本: | 1.5 及以上 |
WordPress版本: | 3.4.1 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
ro_comments_template()
, which allows the comments to be displayed in reverse order (thus the newest comments first, oldest last).
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
<?php if(function_exists('ro_comments_template')) ro_comments_template('', true); else comments_template('', true); ?>
` 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 `
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.
Precondition: comments-topinput.php and tpl_gaestebuch.php are in in your template directory.
<?php if(function_exists('ro_comments_template')) ro_comments_template("/comments-topinput.php"); else comments_template(); ?>
to
<?php if(function_exists('ro_comments_template')) ro_comments_template(); else comments_template(); ?>
If you don't use the Kubrik/Default theme, it is still very easy to build your own template.
A good template to start with is "page.php" and "single.php". Copy "page.php" and rename it.
The line <?php comments_template(); ?>
is important. Change it as described above.
Add a header to your new page, to tell Wordpress it is a template.
e.g.
<?php /* Template Name: Guestbook */ ?>
Page Template Documentation