[BuddyPress Activity +] URGENT! BUDDYPRESS HELP!

My client has a buddy press site. I simply need each group to show a list of names of members instead of avatars, preferably under the cover photo instead of on top of it.

The other thing is, they want the members' directory to show also the groups each member is a part of, Currently it only shows name phone number and email.

  • Adam Czajczyk

    Hello gabaccia

    I simply need each group to show a list of names of members instead of avatars, preferably under the cover photo instead of on top of it.

    By default BuddyPress is showing list of members of the group in the "Members" tab, it's below the cover photo and includes an avatar, username and when there was last activity from a given member.

    With such configuration, you can easily hide avatar and the "date" with an additional CSS added to site:

    .group-members .group_members .avatar,
    .group-members .group_members .activity {
    	display:none!important;;
    }

    This would simply hide those extra information, leaving only usernames.

    However, if your site displays this member list in a different way it might be caused by either a theme or some customization or some additional plugin related to it and the CSS might be different. I'd need to see it to be able to adjust CSS code :slight_smile:

    The other thing is, they want the members' directory to show also the groups each member is a part of, Currently it only shows name phone number and email.

    Yes, that can be done with an additional code snippet:

    <?php 
    
    function bp_members_directory_list_member_groups() {
    
    	$groups_html = '<div class="members_groups">';
    
    	$group_ids = groups_get_user_groups( bp_get_member_user_id() );
    
    	foreach( $group_ids["groups"] as $group_id ) {
    
    		$groups_html .= ' <a title="View group page" href="' .home_url() . '/groups/' . groups_get_group( array( 'group_id' => $group_id ) ) -> slug . '">' .
    		groups_get_group( array( 'group_id' => $group_id ) ) -> name . '</a> ';		
    
    	}
    	$groups_html .= '</div>';
    
    	echo $groups_html;
    
    }
    add_action( 'bp_directory_members_item', 'bp_members_directory_list_member_groups' );

    To use it on site add it as an MU plugin:

    - create an empty file with a .php extension (e.g. "bp-members-list-show-groups.php")
    - copy and paste above code into it (using some "clean text" editor such as for example notepad++, sublime or similar)
    - upload the file to the "/wp-content/mu-plugins" folder of your WordPress install; if there's no "mu-plugins" folder inside "wp-content" folder, just create an empty one first.

    Best regards,
    Adam

  • Predrag Dubajic

    Hi gabaccia,

    I'm afraid that we don't offer development services but we do try to help members as much as we can in scope of support.
    What Adam explained above should be pretty straightforward so I would suggest following his steps and if you get stuck somewhere let us know here.

    If you still need developer help you can check with the guys from Codeable:
    https://premium.wpmudev.org/partners/#wpmud-hg-discounts-services

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.