Reputation: 13103
I have bbPress 2.1.2 and BuddyPress 1.6.1 installed on a WordPress 3.4.2 site.
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.
How do I remove Gravatar completely from WordPress and use BuddyPress' avatars instead? 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
Upvotes: 0
Views: 1765
Reputation: 506
Please try this code and put it into the your functions.php file in theme:
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.
Upvotes: 1