This topic has 4 replies, 3 voices, and was last updated 9 years by troy7890.

  • Author

    Tagged: 

  • #46116
     troy7890
    Participant

    Hello – I would like to be able to add a function to this theme that will add a default photo to profiles who have not yet uploaded one yet.

    Displaying the member’s page as it is now, shows text in the photo position. And the text reads – “Profile picture of (Name)”. It really messes up the appearance. Also it’s an issue on the homepage when the member’s grid is used – like in your demo.

    Hopefully it’s something we can add to the functions.php file and also something for a future update.

    Thanks for the great support and theme!

    #46399
     Radu
    Moderator

    Hello,

    You can find more information about this here : http://premium.wpmudev.org/blog/how-to-add-a-custom-default-avatar-for-buddypress-members-and-groups/ and here https://buddypress.org/support/topic/changing-the-default-mystery-man-avatar/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #47051
     troy7890
    Participant

    Here’s what I have in my child functions file. It’s not working though. And yes this .png is on the server in that location. Please advise, thanks.

    COPY CODE
    // change default avatar for members
    function myavatar_add_default_avatar( $url )
    {
    return get_stylesheet_directory_uri() .'/images/BGL-icon72.png';
    }
    add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );
    add_filter( 'bp_group_gravatar_default', 'myavatar_add_default_avatar' );
    #47104
     sharmstr
    Moderator

    I could never get that to work either. Here’s what I use on my sites. It will add another option in WP Admin > Settings > Discussion

    COPY CODE
    
    /**
    * Add a default avatar to Settings > Discussion
    **/
    add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
    define ( 'BP_AVATAR_DEFAULT', 'http://yoursite/wp-content/uploads/2014/10/default_avatar.jpg' );
    define ( 'BP_AVATAR_DEFAULT_THUMB', 'http://yoursite/wp-content/uploads/2014/10/default_avatar_thumb.jpg' );
    

    Obviously change the url and image names, then set it in Discussions

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #47324
     troy7890
    Participant

    Works perfectly – thanks for helping with this feature!

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?