Skip to:
Content
Pages
Categories
Search
Top
Bottom

Group Avatars, how to change the default

  • I’ve been going through this for a long time now and I can’t seem to figure it out.

    WHERE ARE THE AVATARS DEFINED. I could have sworn I saw the random generator somewhere in the code before, but I didn’t need it then!

    I know that when you go to create a new group, the avatar is randomly taken from http://www.gravatar.com and you get some random crazy pattern.

    All I would like to know is, where is that defined.

    OR

    I would like to know how to change it so that my image (I’ve created a default group avatar), is the default group avatar. I don’t want anymore crazy patterns.

    On another note to avatars.

    I’m using the bp-events component, and for some reason the avatar that is generated is always http://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=wavatar&s=150 and I really need to change that.

    But I have a feeling if you help me fix my first problem, I’ll be able to fix the other.

    Thank You

    -Nick

Viewing 8 replies - 1 through 8 (of 8 total)
  • Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    The code for fetching avatar resides in buddypress/bp-core/bp-core-avatar.php

    checkout this function there

    bp_core_fetch_avatar

    There are several filters there and you can use those filters to manipulate the things better.

    Brajesh, you’re very helpful.

    I’ll fiddle around there for a bit and see what I can do.

    I’ve already started seeing something happening, so that’s a good sign.

    Thanks

    Hmm, now in this code, it’s ‘fetching’ the avatars, but is this the code that is actually ‘generating’ the random code for the avatar.

    I’m more looking for the code that will select a random image when you are creating a group, but i’ll keep lookin.

    Sorry for bumping this up, but does anyone know how to change the default avatars?

    Avatar of Michael Eisenwasser
    Michael Eisenwasser
    Participant

    @eisenwasser

    To change the default “member” avatars, go to /wp-content/themes/bp-sn-parent/_inc/images/mystery-man.jpg

    Just override mystery-man.jpg with a new image of the same title.

    Avatar of suzette1970
    suzette1970
    Member

    @suzettekussnercom

    Would really love to change the default group avatar if possible, if anyone figures it out, please post!

    Avatar of Travel-Junkie
    Boris
    Participant

    @travel-junkie

    Add this to your bp-custom.php file:

    function tj_add_default_avatar( $url )
    {
    return get_stylesheet_directory_uri() .'/_inc/images/avatar.jpg';
    }
    add_filter( 'bp_core_mysteryman_src', 'tj_add_default_avatar' );

    You might have to adjust the path and/or change the image name.

    EDIT: Oops, just realized you wanted to change the group avatar. I’ll have a look…

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Closing this thread as it appears we have two threads talking about the same thing.

    Please add to the discussion here:

    http://buddypress.org/forums/topic/group-default-avatar

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

You must be logged in to reply to this topic.