[英]How to remove Gravatar bbPress + BuddyPress + Wordpress?
I have bbPress 2.1.2 and BuddyPress 1.6.1 installed on a WordPress 3.4.2 site. 我在WordPress 3.4.2网站上安装了bbPress 2.1.2和BuddyPress 1.6.1。
The problem is, on the forums, avatar errors show for users who do not have avatars images in /wp-content/uploads/avatars/
instead of the mystery man. 问题是,在论坛上,向
/wp-content/uploads/avatars/
没有头像图像的用户显示了头像错误,而不是神秘人。
How do I remove Gravatar completely from WordPress and use BuddyPress' avatars instead? 我如何从WordPress完全删除Gravatar并使用BuddyPress的化身? In case a user does not have any avatar yet, a default image should show up.
如果用户还没有任何头像,则应显示默认图像。
The source of the erroneous avatars at the moment is like 目前错误的化身的来源就像
http://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=http://mywebsite.com/forums/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg&s=80&r=G
Users who have uploaded their avatars properly, the avatars have source like the following: 正确上传了化身的用户,化身的来源如下:
http://mywebsite.com/forums/wp-content/uploads/avatars/1/d4f01e214d783339fc186ec365307ed1-bpfull.jpg
Please try this code and put it into the your functions.php file in theme: 请尝试以下代码,并将其放入主题中的functions.php文件中:
function myavatar_add_default_avatar( $url ) {
return get_stylesheet_directory_uri() .'/_inc/images/avatar-member.jpg';
}
add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );
Please use your default image to replace gravatar photo. 请使用默认图片替换头像照片。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.