Skip to:
Content
Pages
Categories
Search
Top
Bottom

My Friends List


  • vijaykryadav
    Participant

    @vijaykryadav

    Hello,
    I want to show only my friends list. i have seen the member-loop template but this is showing all registered members of site. Can you please guide me how to achieve that ?

    Thanks

Viewing 1 replies (of 1 total)

  • tronix-ex
    Participant

    @tronix-ex

    You may be find the solution but I am pasting my solution here if someone else needed this.

    <?php
    $user_id = bp_is_user() ? bp_displayed_user_id() : bp_loggedin_user_id() ;
    
    $args = apply_filters( 'bp_show_friends_args', 
    			array( 
    				'user_id'        => $user_id, 
    				'type'           =>'active', 
    				'per_page'       => 6,
    				'max'            => $limit, 
    				'populate_extra' => 0
    			)
    		);
    
    if ( bp_has_members( $args ) ) { ?>
    		    	<ul class="bpsf-members">
    			      <?php while ( bp_members() ) : bp_the_member(); ?>
    
    			      	<li class="bpsf-member">
    				        <div class="item-avatar">
    				          	<a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name();?>">
    				          		<?php bp_member_avatar( $avatar_args ) ?>
    				          	</a>
    				        </div>
    				        <?php do_action( 'bp_show_friends_after_friend_avatar', bp_get_member_user_id() );?>
    				    </li>
    
    			      <?php endwhile; ?>
    			     </ul>
    <?php } ?>
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar