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' );

typecho php

椿sama 8 years, 12 months ago

Your Answer