WordPress自帶的Widgts-“最新評論”默認顯示的是 someone on postname(某人發表于某文章)
如果我們想讓它顯示為someone says: something(某人說了某句話)。
修改WordPress的/includes/widgets.php可以達到目的。
原地址:http://cuteleo.cn/2008/01/07/make-recent-comments-widget-show-comment-content.html
另外,在修改代碼的基礎上,可以加入get_the_title($comment->comment_post_ID)以顯示文章標題。可這樣做,文字變得很長了,所以,我把它寫在 title 裏面。代碼如下:
code.php'<li class="recentcomments">'. sprintf(__('%1$s:%2$s'), get_comment_author_link(), '<a href="' . get_permalink($comment->comment_post_ID). '#comment-' . $comment->comment_ID. '" title="留言於《'. get_the_title($comment->comment_post_ID) . '》">' . $comment_excerpt . '...'. '</a>') . '</li>';