BuddyDev

Search

Add friend button does not appare

Tagged: 

  • Participant
    Level: Initiated
    Posts: 10
    Gianluca Mirizio on #39619

    Hi!
    I do not see any “add a friend” button on the activity.
    Please can you help?
    I have installed BuddyPress Extended Friendship Request and BuddyPress Friends Suggestions Pro but no way to make the button compare.
    Thanks.
    Gianluca

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39622

    Hi Gianluca,
    Thank you for the question.

    By default, BuddyPress does not show the button in activity, that’s why we don’t show it either.

    If you can tell me(by marking a position in activity) where you want the button to appear in activity, I can look into it and provide a solution.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Gianluca Mirizio on #39625

    Many thanks for your answer, I would say that the same position as provided in your plugin BuddyPress Extended Friendship Request, would be great!
    Unfortunately cannot attach a screenshot.
    Anyway starting from activity, at the right position of the picture.
    Hope I made me understood.

    Gianluca

  • Participant
    Level: Initiated
    Posts: 10
    Gianluca Mirizio on #39643

    Hi,
    Have you and update about this problem?
    many thanks in advance.
    Gianluca

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39644

    Hi Gianluca,
    Thank you for the replies. I will be sharing the code by tomorrow.

    Is it ok if the cancel friendship button appears with the activity too or we just need add friends?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Gianluca Mirizio on #39645

    Yes it is ok, even better I would say……..
    Many thanks.
    Gianluca

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39657

    Hi,
    Thank you for the patience.

    I am posting 3 snippets for 3 different positions of the button. Please let me know which one is more suitable and I can assist you with css(all of them need css to put on the same line as other content).

    
    // after activity header actions(first line).
    add_action( 'bp_get_activity_action', function ( $action ) {
    
    	if ( ! is_user_logged_in() ) {
    		return $action;
    	}
    
    	return $action . bp_get_add_friend_button( bp_get_activity_user_id() );
    } );
    

    or

    
    
    // Before delete button.
    add_action( 'bp_activity_entry_meta', function () {
    
    	if ( ! is_user_logged_in() ) {
    		return;
    	}
    
    	echo bp_get_add_friend_button( bp_get_activity_user_id() );
    } );
    
    

    or

    
    // after activity content
    add_action( 'bp_activity_entry_content', function () {
    
    	if ( ! is_user_logged_in() ) {
    		return;
    	}
    
    	echo bp_get_add_friend_button( bp_get_activity_user_id() );
    } );
    

    Please put this in child theme’s functions.php (any one of these) and let me know which one you want to use. I will provide some css for it then.

    Regards
    Brajesh

The topic ‘Add friend button does not appare’ is closed to new replies.

This topic is: not resolved