Skip to:
Content
Pages
Categories
Search
Top
Bottom

group default avatar


  • MJ
    Participant

    @jimcale

    hello everyone.

    I understand the default avatar for groups is generated from Gravatar. is there anyway i can define my own default avatar for groups.

    thanks a lot in advance.

Viewing 7 replies - 26 through 32 (of 32 total)

  • gwu123
    Participant

    @gwu123

    Here is my code. However, the small group avatar in forum topic directory does not change. This avatar is displayed using bp_the_topic_object_avatar() from bp-forums-templates.php

    function my_default_get_group_avatar($avatar) {
    global $bp, $groups_template;

    if( strpos($avatar,’group-avatars’) ) {
    return $avatar;
    }
    else {
    $custom_avatar = get_stylesheet_directory_uri() .’/_inc/images/group_avatar.png’;
    if($bp->current_action == “” || $bp->current_action == “my-groups” || $bp->current_action == “invites” )
    return ‘group->name ) . ‘” />’;
    else
    return ‘group->name ) . ‘” />’;
    }
    }
    add_filter( ‘bp_get_group_avatar’, ‘my_default_get_group_avatar’);


    r-a-y
    Keymaster

    @r-a-y


    gwu123
    Participant

    @gwu123

    thnks Ray


    gwu123
    Participant

    @gwu123

    @r-a-y. I want to have a fixed size for group/user avatars in the sidebar. Is there a way to detect and fix the size of avatars in sidebar?
    Thanks.


    r-a-y
    Keymaster

    @r-a-y

    Sorry for replying late to this thread. I missed this one.
    I’ll look into this when I have the time.


    gwu123
    Participant

    @gwu123

    hi @r-a-y

    I am using your code given at : Click Here

    I am using this plugin:https://buddypress.org/community/groups/jet-group-could/

    When I browse user profile -> my groups, the group avatars in the sidebar become thumbails even though I have set 25X25 size in this plugin. Is there a way to fix the size if avatars displayed in the sidebar? I want any avatar showed in sidebar to be 25X25

    thanks.


    r-a-y
    Keymaster

    @r-a-y

    Since you’re using the filter I posted, I would manually setup a group loop. Then in this loop, I would use the bp_core_fetch_avatar() function with the “html” parameter set to false (view the full function and parameter list in /bp-core/bp-core-avatars.php).

    Doing this will return the URL of the avatar, then you can manually define the width and height in an IMG tag.

Viewing 7 replies - 26 through 32 (of 32 total)
  • The topic ‘group default avatar’ is closed to new replies.
Skip to toolbar