Loading... ## 介绍 当我们在很多博客或者网站留言,评论的时候会看到有的人头像很酷很个性化,但是这个博客和网站本身并没有提供设置头像的功能,感觉有点神奇,那么是怎么做到的呢?其实这是使用了Gravatar。 Gravatar,全称Globally Recognized Avatar。翻译成中文为`全球通用头像`。 Gravatar的概念首先是在国外的独立WordPress博客中兴起的,当你到任何一个支持Gravatar的网站留言时,这个网站都会根据你所提供的Email地址为你显示出匹配的头像。当然,这个头像,是需要你事先到Gravatar的网站注册并上传的,否则,在这个网站上,就只会显示成一个默认的头像。 当你访问支持gravatar头像的网站时,只要输入你注册的邮箱账号,即会自动调用gravatar的api,转换成保存的头像。这样就可以为广大程序提供个人头像存储服务。 ## 使用 使用该服务时需要去[官网](https://cn.gravatar.com/)中注册一个账号,并上传头像。 注意头像上传后会审核,然后管理员会按图片包含的内容划分一个等级(G 普通级、PG 辅导级、R 和 X 为限制级)。 通过之后这个头像就可以使用了。在任何支持Gravatar的地方,在评论填写email地址时,请填写你申请注册头像用的这个email地址。你的头像就会出现在留言中。就这样可以展示给大家看了 ## 调用 由于gravatar目前服务极不稳定,调用时推荐用国内的源。 换源方法:一般在模板文件的`functions.php`文件中,搜索gravatar,把搜索到的域名直接替换掉即可,handsome主题可在主题设置中修改。 本站使用的是自建的镜像源。`gravatar.zeruns.tech/avatar/` 我的自建镜像源使用了[百度云加速](https://blog.zeruns.tech/archives/386.html)和[金山云](http://ksyun.com/s/8notTC)CDN,欢迎大家使用。 以下个人整理备份。 - Zeruns's Blog的源:[https://gravatar.zeruns.tech/avatar/](https://gravatar.zeruns.tech/avatar/) - 宝硕博客的源:[https://gravatar.baoshuo.ren/avatar](https://gravatar.baoshuo.ren/avatar) - gravatar官方的www源 [https://www.gravatar.com/avatar/](https://www.gravatar.com/avatar/) - gravatar官方的cn源 [https://cn.gravatar.com/avatar/](https://cn.gravatar.com/avatar/) - gravatar官方的en源 [https://en.gravatar.com/avatar/](https://en.gravatar.com/avatar/) - gravatar官方的secure源 [https://secure.gravatar.com/avatar/](https://secure.gravatar.com/avatar/) - V2EX源 [https://cdn.v2ex.com/gravatar/](https://cdn.v2ex.com/gravatar/) - Loli源 [https://gravatar.loli.net/avatar/](https://gravatar.loli.net/avatar/) - 极客族 [https://sdn.geekzu.org/avatar/](https://sdn.geekzu.org/avatar/) 不过当然,有兴趣的同学可以自建镜像。可以利用Nginx反代`https://www.gravatar.com/`这个域名,然后就可以用你自己的域名访问啦。 以上部分介绍整理自百度百科:[https://baike.baidu.com/item/Gravatar/10996811](https://baike.baidu.com/item/Gravatar/10996811) ## 推荐文章 - 高性价比和便宜的VPS/云服务器推荐:[https://blog.zeruns.tech/archives/383.html](https://blog.zeruns.tech/archives/383.html) - CDN推荐:[https://blog.zeruns.tech/archives/386.html](https://blog.zeruns.tech/archives/386.html) - 怎样搭建个人博客:[https://blog.zeruns.tech/archives/218.html](https://blog.zeruns.tech/archives/218.html) - 各大云服务器厂商618活动优惠大全:[https://blog.zeruns.tech/archives/549.html](https://blog.zeruns.tech/archives/549.html) - 使用WebP节省网站流量和存储空间,加快网站加载速度:[https://blog.zeruns.tech/archives/547.html](https://blog.zeruns.tech/archives/547.html) <hr class="content-copyright" style="margin-top:50px" /><blockquote class="content-copyright" style="font-style:normal"><p class="content-copyright">版权属于:<font color="blue">zeruns</font>(除特别注明外)</p><p class="content-copyright">本文链接:<a class="content-copyright" href="https://blog.zeruns.tech/archives/447.html"><font color="blue">https://blog.zeruns.tech/archives/447.html</font></a></p><p class="content-copyright">本站文章采用 <a class="content-copyright" target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/"><font color="blue">知识共享署名4.0 国际许可协议</font></a> 进行许可,请在转载时注明出处及本声明!</p></blockquote> 最后修改:2020 年 06 月 08 日 01 : 17 AM © 允许规范转载 赞赏 如果您觉得我的文章有帮助,请随意赞赏,赞赏有助于激发博主的热情,感谢! ×Close 赞赏作者 扫一扫支付 支付宝支付 微信支付
functions.php打不开怎么办?
这个文件加密了,加密方式好像是mzphp,你网上搜一下有解密的平台,解密了不要传播,尊重版权
谢谢大佬分享,学到了!
我自己也建了一个,教程:https://blog.baoshuo.ren/archives/61.html ,镜像源查看地址:https://blog.baoshuo.ren/apilist.html (有CDN)
可不可以加一下呀大佬
加上了 ::BZ:33_hecha::
谢谢大佬分享,学到了!