由于默认的0.gravatar.com被墙,只能转用cn.gravatar.com中国站点。
在functions.php底部加上改代码:
function get_ssl_avatar($avatar) { $avatar = preg_replace('/.*\/avatar\/(.*)\?s=([\d]+)&.*/','<img class="avatar avatar-$2" alt="" src="https://cn.gravatar.com/avatar/$1?s=$2" width="$2" height="$2" />',$avatar); return $avatar; } add_filter('get_avatar', 'get_ssl_avatar');
转载请注明:宿居博客 » wordpress头像无法加载