梦魂

wordpress解决gravatar无法显示

在任意主题下的functions.php里添加如下代码:

// HackGravatar
function wpyou_get_ssl_avatar($avatar) {
$avatar = preg_replace('/.*\/avatar\/(.*)\?s=([\d]+)&.*/','',$avatar);
return $avatar;
}
add_filter('get_avatar', 'wpyou_get_ssl_avatar');

退出移动版