花開未央

WordPress博客中gravatar头像无法显示的解决办法

最近GFW又发神经,居然墙掉了gravatar!墙你妹啊墙!!!喵了个咪的!!!!

幸好有位朋友给了我tips,让我blog安然度过这一劫,嗯,现在就拿来分享给大家吧。

方法是修改wp-includes文件夹下面的pluggable.php文件。

转到1645行看到这些代码:
[code type=php]
if ( is_ssl() ) {
$host = ‘https://secure.gravatar.com’;
} else {
if ( !empty($email) )
$host = sprintf( “http://%d.gravatar.com”, ( hexdec( $email_hash{0} ) % 2 ) );
else
$host = ‘http://0.gravatar.com’;
}
[/code]
修改成下面这些代码然后保存覆盖,Gravatar评论头像就可以显示了。
[code type=php]
if ( is_ssl() ) {
$host = ‘https://secure.gravatar.com’;
} else {
$host = ‘http://www.gravatar.com’;
}
[/code]

退出移动版