任何主题,打开functions.php文件,将以下代码复制放到该文件最前,注意在第一个<?php
之后。
//多说官方Gravatar头像调用 function mytheme_get_avatar($avatar) { $avatar = str_replace(array("www.gravatar.com","0.gravatar.com","1.gravatar.com","2.gravatar.com"),"gravatar.duoshuo.com",$avatar); return $avatar; } add_filter( 'get_avatar', 'mytheme_get_avatar', 10, 3 );