Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding “Add Friend Button” inside the loop

  • Avatar of talha8877
    talha8877
    Participant

    @talha8877

    I’m trying to place an “Add Friend” button outside of the members page, inside a loop, so the button appears next to the author’s avatar in a post. I tried adding ;

    `if ( bp_is_active( ‘friends’ ) ) {

    bp_add_friend_button( $user_ids['users'][$i]->id )

    } `

    Inside the loop but it didn’t return any results. Then I placed the following action hook in functions.php, it displayed the button inside the loop but once clicked, all the buttons in the post list got clicked as well.

    ` add_action( ‘the_content’, ‘bp_add_friend_button’, 5 );`

    I’m a nb in buddypress & wp and I’m stuck. I thought, adding a template tag inside the template would work since it had worked for “Send Message” button.

You must be logged in to reply to this topic.