Quantcast
Channel: 《解决WordPress博客Gravatar头像被墙无法显示的问题》的评论
Viewing all articles
Browse latest Browse all 29

作者:acity_waiting

$
0
0

其实WordPress博客用户可以将下面代码添加到当前主题的functions.php文件中就可解决Gravatar头像不显示问题。
<code>
//=== Gravatar头像缓存 ===//
function gravatar_cache($avatar){
$avatar = preg_replace( "/http://(www|d).gravatar.com/","http://gravatar.hechaocheng.cn&quot;,$avatar );
$avatar = preg_replace( "/?s=/",".png?s=",$avatar );
return $avatar;}
add_filter( ‘get_avatar’, ‘gravatar_cache’ );
</code>


Viewing all articles
Browse latest Browse all 29