Skip to:
Content
Pages
Categories
Search
Top
Bottom

Simply display friends of member

  • @aliceg

    Participant

    Hello,
    I found a lot of tips to show friends in a template page, but none of them work! So do you know…
    How to display a friends list of a member?
    Thank you a lot 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • @shanebp

    Moderator

    Members Loop

    What have you tried?
    Use gist or pastebin to show your code.

    @aliceg

    Participant

    Thank you for your reply. I will put all my “solutions” here :

    Last solutions :

    $is_friend = friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() );
    
    if($is_friend) {
       bp_member_profile_data();
    }

    This work but only show the count, and I would like the avatars and links :

    if ( is_user_logged_in() ) :
    		if ( bp_is_active( 'friends' ) ) :	
    
    			echo '<br/><br/>'. bp_get_total_friend_count( $user_id ) .'';
    			  
    		endif;
    	endif;

    This shounl be a good idea… but it shows all my members…

    if ( bp_has_members( 'user_id optional=true') ) : ?>
    <?php bp_get_template_part( 'members/members-loop' ) ?>
    <?php endif; 

    Do you know the action code to display realy easily?
    Thank you !

    @shanebp

    Moderator

    The solution is on the codex page that I provided a link to.

    Create a custom members loop:

    <?php if ( bp_has_members( 'user_id=' . bp_loggedin_user_id() ) ) : ?>
      //etc
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Simply display friends of member’ is closed to new replies.
Skip to toolbar