Loading... 最近发现博客评论区头像不显示,发现原因是Gravatar服务器被墙,网友给出了不错的解决办法,经测试成功。gravatar.duoshuo.com是由知名社交评论服务商多说提供的国内Gravatar服务,大家可以放心使用,且不用担心速度问题 修改方法: 任何主题,<strong>打开functions.php文件,将以下代码复制放到该文件最前</strong>,注意在第一个<code><?php </code>之后 <pre></pre> <blockquote> <pre>function mytheme_get_avatar($avatar) { $avatar = str_replace(array("www.gravatar.com","0.gravatar.com","1.gravatar.com","2.gravatar.com"),"gravatar.duoshuo.com",$avatar); return $avatar; } add_filter( 'get_avatar', 'mytheme_get_avatar', 10, 3 );</pre> </blockquote> 修改前记得备份该文件。。。 Last modification:October 6, 2023 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 如果觉得我的文章对你有用,请随意赞赏
8 comments
支持下
我的开了头像显示,网站加载特别慢,你这个不是多说吧
我的的确是多说!
提示未定义函数add_filter()
我也用的这种方法。
试试看 后端代理这些请求,反正你服务器 也在国外
之前有用过缓存之内的,效果不太好!也就不想折腾了!
看看能显示吗