Hi,
default avatar is ‘gravatar’ ‘s mytery man. To use your own avatar, you have to deactivate gravatar in addition to constant. Try this in bp-custom.php
add_filter('bp_core_fetch_avatar_no_grav', '__return_true');
define ( 'BP_AVATAR_DEFAULT_THUMB', 'YOURIMAGEURL' );
Hi @danbp,
Thanks for reply. Yeah I’ve already got the gravatar code in bp-custom and all the define’s here work fine apart from the BP_AVATAR_DEFAULT_THUMB
for some reason.
Is define ( 'BP_AVATAR_DEFAULT', $img_url );
supposed to change thumbnail avatars too as that is what is happening (which seems to compensate for the thumb define not working but is odd)?
In addition to that, are there equivalents for setting the cover-image dimensions? The closest I have come across is the filter apply_filters( 'bp_attachments_get_cover_image_dimensions', $wh, $settings, $component );
. Is that the right one to use?
Cheers
Have you tried both lines i indicated previously ?
Also, what about thumbnail size in WP settings ? Have you checked that ?
I’m not very well with attachments… But you’re proably right. See her for all bp_atachment references
http://hookr.io/plugins/buddypress/#index=a&search=bp_attachments
Yeah I’ve got both lines in there already. Double checked by commenting out mine and copy paste yours too. To no avail though.
Altering the thumbnail size (width/height) etc is fine, the defines work for those for both the full size and the thumb size. Its just changing the actual image of the thumbnail using define ( 'BP_AVATAR_DEFAULT_THUMB', $img_url );
.
Came across this post from a couple of years ago where Henry has had the same issue it seems. Don’t know if it got resolved…
https://buddypress.org/support/topic/bp_avatar_default_thumb-broken/
define ( ‘BP_AVATAR_DEFAULT_THUMB’, $img_url );
This was not working for me either, in the end this combination did. Turning off gravatar (first filter), and then a default bp image filter.
add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
add_filter( 'bp_core_default_avatar_user', 'override_default_avatar', 10, 2 );
function override_default_avatar( $default, $params ) {
if ( !empty($params) ) {
if ( 'thumb' == $params['type'] ) {
return get_stylesheet_directory_uri() . '/img/avatar-thumb.jpg';
}
}
return get_stylesheet_directory_uri() . '/img/avatar.jpg';
}
Hello. but how do I let my users view the photos you have uploaded to their profile BuddyPress completely disabling gravatar? thank you for support