type
status
date
slug
summary
tags
category
icon
password
Cravatar
Cravatar 是 Gravatar 在中国的完美替代方案,在此你可以自由的上传和分享头像。
解决办法
- 后台添加代码


- 将以下代码粘贴至主题文件夹内的 functions.php 最下方
/*修复wordpress上Cravatar头像无法显示问题*/ if ( ! function_exists( 'get_cravatar_url' ) ) { /** *替换Gravatar头像为Cravatar头像 * * @param string $url * * @return string */ function get_cravatar_url( $url ) { $sources = array( 'www.gravatar.com', '0.gravatar.com', '1.gravatar.com', '2.gravatar.com', 'secure.gravatar.com', 'cn.gravatar.com' ); return str_replace( $sources, 'cravatar.cn', $url ); } add_filter( 'um_user_avatar_url_filter', 'get_cravatar_url', 1 ); add_filter( 'bp_gravatar_url', 'get_cravatar_url', 1 ); add_filter( 'get_avatar_url', 'get_cravatar_url', 1 ); }
- 完成设置

- Author:Gweek
- URL:https://www.myla.eu.org/article/wordpress-1
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!