WordPress 2.6中文版更新以后,我才正正经经的看了看新的后台变化,尤其是对theme制作来说,必须要知道哪里的变化是必须改进的。

丰富的头像选择。除了默认的头像之外,2.6在gravater上又增加了三个新选择,统统是可以根据用户的信箱地址生成唯一的头像——以避免没有注册gravater服务的留言用户头像千篇一律。没记错的话这三个新头像模式好像原来都是插件,应该是集成进去了。

博主只需要前往后台-设置-评论进行设置即可。

当然,对于某些主题(比如我的)来说,这样的设置还不够。因为有些主题设置了单独的默认头像。如果你使用的也是这样的主题(更改后台头像设置后前台没有看到五彩缤纷的用户头像),那么也很简单,比如我的主题关于头像部分的代码是(comments.php中):

  1. <?php echo get_avatar( $comment, 32, 'http://www.underone.com/wp-content/uploads/2008/04/avatar.png' ); ?>

只需修改为

  1. <?php echo get_avatar( $comment, 32 ); ?>

然后再到前台找个留言多的post看看,是不是头像都变得花里胡哨了?

本文精巧网址: http://go.6.cn/1r0b

, , , ,

Bookmark and Share 17fav 收藏本文

引用地址:http://www.underone.com/2008/07/17/more-gravatar-at-wordpress-26/

楼被抢了31层了


  1. adminReply to this comment Says @ 08-07-17 11:52 am (1)
  2. <img src="comment_author_email) . '?s=32&r=any&default=' . urlencode(get_bloginfo('template_url') . "/images/gravatar.png"); ?>" class="gravatar" alt="" />

    不知道我这个要怎么改,我不想将原来的样式去掉

    胡戈戈Reply to this comment Says @ 08-07-17 1:07 pm (2)
  3. 把这部分直接删除试试?
    // &default=' . urlencode(get_bloginfo('template_url') . "/images/gravatar.png //

    underoneReply to this comment Says @ 08-07-17 1:31 pm (3)
  4. 默默哥哥你email是什么呀。。我信箱就是给你评论的这个。。
    麻烦帮我把LOGO的两个字改成风吟拉。谢谢!

    风吟Reply to this comment Says @ 08-07-17 2:15 pm (4)
  5. 发你了

    underoneReply to this comment Says @ 08-07-17 2:41 pm (5)
  6. 2.5开始我就是用调用=.=

    MaoReply to this comment Says @ 08-07-17 2:57 pm (6)
  7. 其实那个 Don't show avatars 是禁用整个 Blog 的头像, 甚至连后台的头像都不会显示.
    WordPress 中获取头像的方法 get_avatar 会在最先通过对 get_option('show_avatars') 的检验确定是否能够显示头像, 如果不能则立刻返回 false. 这个方法在 2.5 中已是这么定义了. 看来 WordPress 2.5 只是 2.6 的序幕.

    mg12Reply to this comment Says @ 08-07-17 9:34 pm (7)
  8. 2.6为数不多的亮点~

    打篮球的手Reply to this comment Says @ 08-07-17 10:42 pm (8)
  9. 好乱哦..
    WP越来越垃圾了..

    强烈支持 Typecho 和 70 同志..

    锐风Reply to this comment Says @ 08-07-18 8:57 am (9)
  10. wp的初衷还是好的,不过结果就不一定了,任何一个系统都不可能面面俱到,有时候反而是简单点好...

    FlyxReply to this comment Says @ 08-07-18 12:12 pm (10)
  11. 没错。。

    underoneReply to this comment Says @ 08-07-18 1:25 pm (11)
  12. wp的初衷还是好的,不过结果就不一定了,任何一个系统都不可能面面俱到,有时候反而是简单点好...

    underReply to this comment Says @ 08-07-18 6:43 pm (12)
  13. - -testing...

    SKReply to this comment Says @ 08-07-18 7:08 pm (13)
  14. 让我来试试自己的头像会是什么样子的呢?~~~

    cXYReply to this comment Says @ 08-07-19 5:14 am (14)
  15. 哈哈~~~果然是,gravatar.com里面的头像!只要是填的注册gravatar.com里面的email地址,到哪里都是一样的头像吧?

    cXYReply to this comment Says @ 08-07-19 5:18 am (15)
  16. 是的

    underoneReply to this comment Says @ 08-07-19 8:30 am (16)
  17. 是的,看看先

    xmwikiReply to this comment Says @ 08-07-20 9:47 am (17)
  18. 我就不用,就不用,就不用…… T___T

    虫儿飞Reply to this comment Says @ 08-07-20 2:03 pm (18)
  19. 新版本出来了啊~! 我也要升咯~!

    randemReply to this comment Says @ 08-07-21 2:31 pm (19)
  20. 啊哈,原来还有这个新功能。

    冰古Reply to this comment Says @ 08-07-23 3:12 am (20)
  21. 原来是这样啊

    长毛Reply to this comment Says @ 08-07-24 1:45 pm (21)
  22. 你看,还有用你的纹身当头像的呢
    http://www.underone.com/2008/07/23/redcliff/

    underoneReply to this comment Says @ 08-07-24 2:02 pm (22)
  23. 原来是这样啊

    迪纳替你Reply to this comment Says @ 08-07-30 9:49 am (23)
  24. 确实好看多了,不错

    黑色饼干Reply to this comment Says @ 08-07-30 10:43 pm (24)
  25. 默認的三個自動生成都不好看,不知道有沒有更多的選擇。。

    LeeiioReply to this comment Says @ 08-07-30 11:12 pm (25)
  26. <img src="comment_author_email) . '?s=32&r=any&default=' . urlencode(get_bloginfo('template_url') . "/images/gravatar.png"); ?>" class="gravatar" alt="" />

    这一段代码真的不知道怎么弄啊。请帮个忙。

    JasonReply to this comment Says @ 08-08-2 1:42 am (26)
  27. 我试试会不会有新的头像。

    nwgaleReply to this comment Says @ 08-08-20 5:05 pm (27)
  28. @nwgale: 没有。。。

    underoneReply to this comment Says @ 08-08-20 5:58 pm (28)
  29. @Jason: 要弄啥?

    underoneReply to this comment Says @ 08-08-20 5:58 pm (29)
  30. 怎么把头像放到右边是我关心的问题!!!!

    jokerccReply to this comment Says @ 08-09-29 1:19 pm (30)
  31. 测试一下头像,,,-_-!!!

    iColorReply to this comment Says @ 08-10-3 9:26 pm (31)

Trackbacks & Pingbacks

  • wordpress头像设置 | 望月的博客

    [...] 想在自己的wordpress博客中显示评论这头像吗?如果是支持显示头像的模板,直接设置显示头像即可,如果不行可以这样修改。如果你是使用wordpress2.5,可以参考这篇文章进行设置,如果是使用更旧的版本,可以使用WP Gravatar 插件或者Gravatars2 插件。 [...]

要说点啥就在这吧

收藏 & 分享

Powered by 17fav.com