For that purpose, please put the following line too in your bp-custom.php
add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
That forces BuddyPress to avoid using gravatar and use local avatars for default(when no avatar is uploaded).
Hope that helps
That shut my site down completely with a syntax error – it could not process the line.
Hi,
sorry about the trouble. Please make sure that you put that line in php block. Either before the closing ‘?>’ or after the ‘<?php’ tag.
The following code…
<?php
// Use this file to customize Buddy Press
// This section changes the default avatar to the picture of a box
// the picture is uploaded into WordPress
add_filter( 'bp_core_fetch_avatar_no_grav','__return_true' );
define ( ‘BP_AVATAR_DEFAULT’, ‘http://www.truesouthernmen.com/wp-content/uploads/2015/10/0307152159-02-300×225.jpg’ );
define ( ‘BP_AVATAR_DEFAULT_THUMB’, ‘http://www.truesouthernmen.com/wp-content/uploads/2015/10/0307152159-02-300×225.jpg’ );
?>
Returns this error when loading the page…..
Fatal error: Can’t use function return value in write context in /home/cody7670/public_html/wp-content/plugins/bp-custom.php on line 8
OK, for some reason that did not cut and paste correctly. The add_filter line looks like this.
add_filter( 'bp_core_fetch_avatar_no_grav','__return_true' );
Dude, that is weird. I figured it out. When BuddyPress forums emailed me your response, it added extra characters in the Email. Then, when I cut and paste it back into BuddyPress forums, the extra characters were removed. I changed the code to remove the extra characters the Email added and the error went away.
Hi,
No problem. The bbPress encodes the code.It is always better to avoid the code in email and copy paste from forum itself.
Is the issue fixed now?
Yes, it worked. Everyone has an actual avatar now instead of a box with the text that says, “picture of username”
Thanks for the help.
No problem. Thank you for confirming 🙂