WP-RecentComments 1.1

WP-RecentComments

简介:
我在主题 Blocks Theme 中, 将侧边栏显示最新评论的功能剥离了出来, 做成这个插件. 这次更新追加大量功能, 支持 WordPress 2.5.x, 能通过 W3C XHTML 1.1 和 CSS 3 验证. 但 2.3.x 或以下版本无法使用头像功能.

功能:
在侧边栏中显示最新的评论.

安装:
1. 将压缩包解压到 /wp-content/plugins/.
2. 打开文件 wp-recentcomments.css, 将所有代码拷贝并追加到 style.css (/wp-content/themes/{$你的模板}/style.css).
3. 登录你的 WordPress 后台, 到 Plugins 页面激活插件 WP-RecentComments.
4. 打开 sidebar.php, 在适当位置追加以下代码:
<h3>最新评论</h3>
<ul><?php get_recentcomments(); ?></ul>

参数:

limit: 整数, 显示最新评论的数量. (defalue: 5)
length: 整数, 每个评论显示的字符长度. (defalue: 50)
post: true 或 false, true: 显示文章标题. (defalue: true)
pingback: true 或 false, true: 显示反连接类型的评论. (defalue: true)
avatar: true 或 false, true: 显示评论者的头像. (defalue: false)
avator_size: 整数, 头像的长和宽. (defalue: 32)
avatar_position: left 或 right, 头像的显示位置. (defalue: left)

你可以通过上面的参数改变最新评论的显示方式, 例如:
<?php get_recentcomments('limit=10&length=20&post=false'); ?>
<?php get_recentcomments('pingback=flase'); ?>
<?php get_recentcomments('avatar=true&avatar_size=16&avatar_position=right'); ?>

插件下载: Download

更新:
Version 1.1 [2008/05/09]
1. 改, 更改传参方式.
2. 改, 评论数目上限改为 20.
3. 增, 对反链接类型的评论, 可选择显示或不显示.
4. 增, 对文章标题, 可选择显示或不显示.
5. 增, 对头像支持.
6. 增, 为元素增加 className, 以方便自定义样式.
Version 1.1.1 [2008/05/10]
1. 修, 修正评论内容长度最大为 20 个字符的 bug.
Version 1.1.2 [2008/05/11]
1. 修, 修正匿名评论时不显示用户名的问题, 修正评论显示匿名为 "Anonymous".

声明: 本文采用 BY-NC-SA 协议进行授权. 转载请注明转自: WP-RecentComments 1.1
  1. Alan | #1
    May 9th, 2008 at 03:58

    你这个插件是越来越牛了!

  2. Delacro | #2
    May 9th, 2008 at 11:16

    试试看,谢谢!

  3. yeardo | #3
    May 9th, 2008 at 16:46

    Blocks Theme

    又更新了????

  4. mg12 | #4
    May 9th, 2008 at 22:57

    @Alan 一般使用还行, 暂时不支持 Widgets
    @Delacro 谢谢支持...
    @yeardo 还没更新, 只是这个插件的雏形是在那个主题取出来的.

  5. 抽筋儿 | #5
    May 14th, 2008 at 11:20

    好像在widger里丢个添加代码的文本,没有效果。

  6. mg12 | #6
    May 14th, 2008 at 14:41

    @抽筋儿
    本插件目前不支持 Widget.

  7. ZG | #7
    May 14th, 2008 at 21:31

    对了,文章标题支持截断么?发现这个插件在firefox2下,如果文章标题过长的话,头像会错位,具体可以看我的blog。。。 :oops:

  8. mg12 | #8
    May 14th, 2008 at 23:02

    @ZG 你的 Blog 很难打开, 我在 Firefox3, IE6 和 Konqueror 看过, 都没问题. 网速问题, 在 Firefox2 中打不开.

  9. MetalMickey | #9
    May 17th, 2008 at 20:20

    我用的是你的block1.2.2主题,设置了显示头像,可是却没有呢?

  10. it杂志 | #10
    Dec 12th, 2008 at 09:15

    2.7正式版
    激活出错。提示core.php.108行错误

  11. mg12 | #11
    Dec 12th, 2008 at 16:54

    @MetalMickey
    你看看你的 WordPress 头像有激活没?

    @it杂志
    我还没时间装 WordPress 2.7 呢, 过几天吧.

  1. WP-RecentComments 1.1 - Neversay
    May 10th, 2008 at 22:20

Twitter Email feed
RSS feed