typecho的gravatar头像缓存问题

新手上路,请多包涵

最近用typecho建了一个站,但gravatar头像被墙了,在百度上搜索都是wordpress的,要不就是使用插件,修改源文件,但能不能使用wordpress的function.php的办法用到typecho上呢,在wordpress上的function.php写下以下函数可以转到多说源,但typecho的function.php该怎么写呢?能不能实现呢?
function mytheme_get_avatar( $avatar ) {
$avatar = preg_replace( "/http:\/\/(www|\d).gravatar.com/","http://gravatar.duoshuo.com",$avatar );
return $avatar;
}
add_filter( 'get_avatar', 'mytheme_get_avatar' );

阅读 4.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题