Skip to:

How to get friend requests list

  • jehankhan


    how to get friend request list like facebook in header.php
    i put code of request.php in header of buddypress theme i get list of all request i receive when i go to my profile page but when i go outside my profile it shows message that you have no request …
    how can we do this please help regrading this..

    here is the code i paste in header.php

    <?php do_action( ‘bp_before_member_friend_requests_content’ ); ?>

    <?php if ( bp_has_members( ‘type=alphabetical|include=’ . bp_get_friendship_requests() ) ) : ?>

    <div id=”pag-top” class=”pagination no-ajax”>

    <div class=”pag-count” id=”member-dir-count-top”>

    <?php bp_members_pagination_count(); ?>


    <div class=”pagination-links” id=”member-dir-pag-top”>

    <?php bp_members_pagination_links(); ?>



    <ul id=”friend-list” class=”item-list” role=”main”>
    <?php while ( bp_members() ) : bp_the_member(); ?>

    <li id=”friendship-<?php bp_friend_friendship_id(); ?>”>
    <div class=”item-avatar”>
    “><?php bp_member_avatar(); ?>

    <div class=”item”>
    <div class=”item-title”>“><?php bp_member_name(); ?></div>
    <div class=”item-meta”><span class=”activity”><?php bp_member_last_active(); ?></span></div>

    <?php do_action( ‘bp_friend_requests_item’ ); ?>

    <div class=”action”>
    “><?php _e( ‘Accept’, ‘buddypress’ ); ?>  
    “><?php _e( ‘Reject’, ‘buddypress’ ); ?>

    <?php do_action( ‘bp_friend_requests_item_action’ ); ?>

    <?php endwhile; ?>

    <?php do_action( ‘bp_friend_requests_content’ ); ?>

    <div id=”pag-bottom” class=”pagination no-ajax”>

    <div class=”pag-count” id=”member-dir-count-bottom”>

    <?php bp_members_pagination_count(); ?>


    <div class=”pagination-links” id=”member-dir-pag-bottom”>

    <?php bp_members_pagination_links(); ?>



    <?php else: ?>

    <div id=”message” class=”info”>
    <p><?php _e( ‘You have no pending friendship requests.’, ‘buddypress’ ); ?></p>

    <?php endif;?>

    <?php do_action( ‘bp_after_member_friend_requests_content’ ); ?>

  • The topic ‘How to get friend requests list’ is closed to new replies.
Skip to toolbar