正在加载...

blog » WordPress / 软硬一本 » WordPress 2.6让你的留言头像丰富多彩

WordPress 2.6让你的留言头像丰富多彩

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看看,是不是头像都变得花里胡哨了?

Popularity: 46%

延展阅读

RSS 2.0 | leave a response | trackback

41 Responses

  1. Jul 17th, 2008 / 1:07 pm Reply to this comment 胡戈戈 Says:

    <img src="comment_author_email) . '?s=32&r=any&default=' . urlencode(get_bloginfo('template_url') . "/images/gravatar.png"); ?>" class="gravatar" alt="" />

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

  2. Jul 17th, 2008 / 1:31 pm Reply to this comment underone Says:

    把这部分直接删除试试?
    // &default=' . urlencode(get_bloginfo('template_url') . "/images/gravatar.png //

  3. Jul 17th, 2008 / 2:15 pm Reply to this comment 风吟 Says:

    默默哥哥你email是什么呀。。我信箱就是给你评论的这个。。
    麻烦帮我把LOGO的两个字改成风吟拉。谢谢!

  4. Jul 17th, 2008 / 2:41 pm Reply to this comment underone Says:

    发你了

  5. Jul 17th, 2008 / 2:57 pm Reply to this comment Mao Says:

    2.5开始我就是用调用=.=

  6. Jul 17th, 2008 / 9:34 pm Reply to this comment mg12 Says:

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

  7. Jul 17th, 2008 / 10:42 pm Reply to this comment 打篮球的手 Says:

    2.6为数不多的亮点~

  8. Jul 18th, 2008 / 8:57 am Reply to this comment 锐风 Says:

    好乱哦..
    WP越来越垃圾了..

    强烈支持 Typecho 和 70 同志..

  9. Jul 18th, 2008 / 12:12 pm Reply to this comment Flyx Says:

    wp的初衷还是好的,不过结果就不一定了,任何一个系统都不可能面面俱到,有时候反而是简单点好...

  10. Jul 18th, 2008 / 1:25 pm Reply to this comment underone Says:

    没错。。

  11. Jul 18th, 2008 / 6:43 pm Reply to this comment under Says:

    wp的初衷还是好的,不过结果就不一定了,任何一个系统都不可能面面俱到,有时候反而是简单点好...

  12. Jul 18th, 2008 / 7:08 pm Reply to this comment SK Says:

    - -testing...

  13. Jul 19th, 2008 / 5:14 am Reply to this comment cXY Says:

    让我来试试自己的头像会是什么样子的呢?~~~

  14. Jul 19th, 2008 / 5:18 am Reply to this comment cXY Says:

    哈哈~~~果然是,gravatar.com里面的头像!只要是填的注册gravatar.com里面的email地址,到哪里都是一样的头像吧?

  15. Jul 19th, 2008 / 8:30 am Reply to this comment underone Says:

    是的

  16. Jul 20th, 2008 / 9:47 am Reply to this comment xmwiki Says:

    是的,看看先

  17. Jul 20th, 2008 / 2:03 pm Reply to this comment 虫儿飞 Says:

    我就不用,就不用,就不用…… T___T

  18. Jul 21st, 2008 / 2:31 pm Reply to this comment randem Says:

    新版本出来了啊~! 我也要升咯~!

  19. Jul 23rd, 2008 / 3:12 am Reply to this comment 冰古 Says:

    啊哈,原来还有这个新功能。

  20. Jul 24th, 2008 / 1:45 pm Reply to this comment 长毛 Says:

    原来是这样啊

  21. Jul 24th, 2008 / 2:02 pm Reply to this comment underone Says:

    你看,还有用你的纹身当头像的呢
    http://www.underone.com/2008/07/23/redcliff/

  22. Jul 30th, 2008 / 9:49 am Reply to this comment 迪纳替你 Says:

    原来是这样啊

  23. Jul 30th, 2008 / 10:43 pm Reply to this comment 黑色饼干 Says:

    确实好看多了,不错

  24. Jul 30th, 2008 / 11:12 pm Reply to this comment Leeiio Says:

    默認的三個自動生成都不好看,不知道有沒有更多的選擇。。

  25. Aug 2nd, 2008 / 1:42 am Reply to this comment Jason Says:

    <img src="comment_author_email) . '?s=32&r=any&default=' . urlencode(get_bloginfo('template_url') . "/images/gravatar.png"); ?>" class="gravatar" alt="" />

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

  26. Aug 15th, 2008 / 8:13 pm Reply to this comment wordpress头像设置 | 望月的博客 Says:

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

  27. Aug 20th, 2008 / 5:05 pm Reply to this comment nwgale Says:

    我试试会不会有新的头像。

  28. Aug 20th, 2008 / 5:58 pm Reply to this comment underone Says:

    @nwgale: 没有。。。

  29. Aug 20th, 2008 / 5:58 pm Reply to this comment underone Says:

    @Jason: 要弄啥?

  30. Sep 29th, 2008 / 1:19 pm Reply to this comment jokercc Says:

    怎么把头像放到右边是我关心的问题!!!!

  31. Oct 3rd, 2008 / 9:26 pm Reply to this comment iColor Says:

    测试一下头像,,,-_-!!!

  32. Nov 9th, 2008 / 9:54 pm Reply to this comment daniel Says:

    呀,我原来还没在意,现在搞上了

  33. Apr 14th, 2009 / 7:07 pm Reply to this comment 小明猪 Says:

    呵呵,我测试下,看看成功没,另外支持一下··

  34. Apr 17th, 2009 / 1:31 pm Reply to this comment 腾飞 Says:

    我测试一下,

  35. Apr 17th, 2009 / 1:41 pm Reply to this comment 腾飞 Says:

    图片有什么条件吗,我用的是jpg的,怎么没有显示呀,
    我的后台已经设置了自动生成选项

  36. Apr 25th, 2009 / 5:11 pm Reply to this comment 灯笼草 Says:

    弄了半天也没弄好,试试看!

  37. Jun 26th, 2009 / 7:02 pm Reply to this comment 假面的告白 Says:

    我试试看

  38. Jun 26th, 2009 / 7:02 pm Reply to this comment 假面的告白 Says:

    试试看

  39. Jul 9th, 2009 / 3:50 pm Reply to this comment klwz200 Says:

    嗯 我就是这样设置的

  40. Jul 19th, 2009 / 5:19 pm Reply to this comment wordpress头像设置 - 我就喜欢您QWERTY Says:

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

  41. Jan 21st, 2010 / 7:24 pm Reply to this comment wordpress头像设置 - Shidalu.net Says:

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

Leave a Reply