WordPress 2.5 已经将 Gravatar 集成了进来,就没有必要在多一个Gravatar插件了。
在有Gravatar插件的主题里找到Gravatar插件的调用代码,将其替换为一下代码就可以了
<?php if (function_exists('get_avatar')) { ?>
<div class="gravatar">
<?php echo get_avatar(get_comment_author_email(),'64'); ?>
</div>
<?php } ?>
显示 Gravatar 头像的函数是 get_avatar(),get_comment_author_email() 放在留言 loop 中得到留言者的 email 地址。Gravatar 头像基本上全靠这个 email 了,后面的 ’64′ 表示头像显示的宽度、高度均为 64px,最大为 80px。
要自己显示 Gravatar 头像得到www.gravatar.com去注册并上传自己的头像就可以了。
目前在2.5RC2下我用的Popularity Contest 插件和 simple tags 插件不能正常使用。
先看一下我的头像效果
老大,把你的使用插件列表贴出来见识一下呗
wp2.5正式出来了,老大使用一下,分享一下经验
看来我还是一塌糊涂。
试试一下我的行不行,呵呵
终于看到正确的代码了。那个兴备呀!
[...] 自带Gravatar:http://www.xuui.net/wordpress/usr-wp25-gravatar.html If you’re new here, you may want to subscribe to my RSS feed. Thanks for visiting! 标签:upgrade, upload, wordpress, wp2.5 [...]