Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Change the default avatar

Viewing 9 replies - 1 through 9 (of 9 total)

  • Brajesh Singh
    Participant

    @sbrajesh

    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


    silversurfer.wf
    Participant

    @silversurferwf

    That shut my site down completely with a syntax error – it could not process the line.


    Brajesh Singh
    Participant

    @sbrajesh

    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.


    silversurfer.wf
    Participant

    @silversurferwf

    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&#8217; );
    define ( ‘BP_AVATAR_DEFAULT_THUMB’, ‘http://www.truesouthernmen.com/wp-content/uploads/2015/10/0307152159-02-300×225.jpg&#8217; );

    ?>

    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


    silversurfer.wf
    Participant

    @silversurferwf

    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' );


    silversurfer.wf
    Participant

    @silversurferwf

    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.


    Brajesh Singh
    Participant

    @sbrajesh

    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?


    silversurfer.wf
    Participant

    @silversurferwf

    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.


    Brajesh Singh
    Participant

    @sbrajesh

    No problem. Thank you for confirming 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Change the default avatar’ is closed to new replies.
Skip to toolbar