WordPress 解决 Gravatar 头像无法打开问题 使用七牛镜像服务器

编辑主题,在 functions.php 中添加:

 

 

function replace_avatar_url($avatar) {
 $avatar = str_replace(array("www.gravatar.com","0.gravatar.com","1.gravatar.com","2.gravatar.com"),"ds-gravatar.qiniudn.com",$avatar);
 return $avatar;
 }
 add_filter( 'get_avatar', 'replace_avatar_url', 10, 3 );

Leave a Reply

Your email address will not be published. Required fields are marked *

返回主页看更多
狠狠的抽打博主 支付宝 扫一扫