骆驼调频

Camel's FM Blog

更改WordPress的留言/评论的显示顺序

By 骆驼 • 八 18th, 2008 • Category: Web • 64 views • RSS 2.0 Trackback

更改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”);
保存退出,即可。这样评论的显示顺序就被改为以时间降序来显示了.
本文链接:更改WordPress的留言/评论的显示顺序

One Response »

  1. 学习了。谢谢

    Reply

Leave a Reply