更改WordPress的留言/评论的显示顺序
骆驼 发表于 2008-08-18 02:32 | 来源: | 阅读 98 views
更改Wordpress评论显示顺序
Wordpress留言,评论,倒序显示
进入Wordpress安装目录下的wp-includes目录,用文本编辑器打开comment-template.php文件,找到如下代码:
"ORDER BY comment_date"; 在“ORDER BY comment_date”后面加上“DESC”,共三处地方。
$comments = $wpdb->get_results(”SELECT * FROM $wpdb->comments WHERE comment_post_ID = ‘$post->ID’ AND comment_approved = ‘1′ ORDER BY comment_date DESC”);
保存退出,即可。这样评论的显示顺序就被改为以时间降序来显示了.
"ORDER BY comment_date"; 在“ORDER BY comment_date”后面加上“DESC”,共三处地方。
$comments = $wpdb->get_results(”SELECT * FROM $wpdb->comments WHERE comment_post_ID = ‘$post->ID’ AND comment_approved = ‘1′ ORDER BY comment_date DESC”);
保存退出,即可。这样评论的显示顺序就被改为以时间降序来显示了.
关键字:


学习了。谢谢
Reply