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. 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.
Sorry for replying late to this thread. I missed this one.
I’ll look into this when I have the time.
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.
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.