解决知更鸟主题评论头像不显示

Author: 陌小雨Date: 2015-01-10View: 87

更换了知更鸟主题后发现,评论头像都不显示了,通过下面代码顺利解决:

//解决知更鸟主题gravatar头像被墙
function get_ssl_avatar($avatar) {
   $avatar = preg_replace('/.*\/avatar\/(.*)\s=([\d]+)&.*/','<img src="https://secure.gravatar.com/avatar/$1s=$2" class="avatar avatar-$2" height="$2" width="$2">',$avatar);
   return $avatar;
}
add_filter('get_avatar', 'get_ssl_avatar');

刷新下,头像都么么哒回来啦!