Adding “Add Friend Button” inside the loop
-
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.
- The topic ‘Adding “Add Friend Button” inside the loop’ is closed to new replies.