富文本编辑器,推荐editplus.
找到需要插入最新留言的地方。一般的博客类的都在首页侧边栏,打开模板文件(你的网站/wp-content/theme/当前模板)打开sidebar.php
在最新留言处添加 comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' AND user_id='0' ORDER BY comment_date_gmt DESC LIMIT 10';$comments = $wpdb->get_results($sql);$output = $pre_HTML;foreach ($comments as $comment) {$output .= '\n
' . ' ID) .'#comment-' . $comment->comment_ID . '\' title=\'on ' .$comment->post_title . '\'>' . strip_tags($comment->com_excerpt).'
还有段代码不显示作者留言。为 什么要去掉作者的留言呢,道理很简单,一般留言都显示在侧边,如果设置显示10条留言,正好有10位浏览者留言,而作者可能在同一时间内分别进行回复,结 果就是侧边显示的留言全部是作者自己的,不利于站长及时查看是否有新留言并回复。代码如下: comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' AND user_id='0' ORDER BY comment_date_gmt DESC LIMIT 10';$comments = $wpdb->get_results($sql);$output = $pre_HTML;foreach ($comments as $comment) {$output .= '\n
' . ' ID) .'#comment-' . $comment->comment_ID . '\' title=\'on ' .$comment->post_title . '\'>' . strip_tags($comment->com_excerpt).'
根据模板的不同,查找适当的位置。改前记得备份sidebar.php。如果不成功,马上替换重新编辑。