Home > Backend Development > PHP Tutorial > typecho的gravatar头像缓存问题

typecho的gravatar头像缓存问题

WBOY
Release: 2016-06-06 20:30:04
Original
1489 people have browsed it

最近用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建了一个站,但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 Gravatar 地址修改插件,头像加速

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template