Skip to:
Content
Pages
Categories
Search
Top
Bottom

Group Avatars, how to change the default


  • 5609856
    Inactive

    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)

  • 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.


    5609856
    Inactive

    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


    5609856
    Inactive

    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.


    5609856
    Inactive

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

    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.


    suzette1970
    Member

    @suzettekussnercom

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


    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…


    r-a-y
    Keymaster

    @r-a-y

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

    Please add to the discussion here:

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Group Avatars, how to change the default’ is closed to new replies.
Skip to toolbar