Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show Follow Button on Each Member’s Profile Page


  • otty-dev
    Participant

    @ottiya

    Hi there, right now, I only see the follow button on .com/members but not on each individual members’ profile pages. Is there a way to enable this?

    Many thanks in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @ottiya

    On the default templates, there is a “Add Friend” button, and we usually position is just below (or next to) the user’s name and avatar picture. But not every theme has to show BuddyPress content in the same way!

    If you’ve bought a theme with BuddyPress templates, or customised some yourself, it might be worth going back to where you got them from and ask for help.


    otty-dev
    Participant

    @ottiya

    Hi @djpaul

    My theme was not built to be compatible with Buddypress unfortunately. Where can I edit the php and html myself for this issue? I was trying to navigate plugin > editor > buddypress but I couldn’t find the php for each members profile page and also the html file. So far I could only edit CSS using appearance > customize css.

    BuddyPress adds the friends button via the action:

    add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );

    You’re saying “follow” so I’m assuming that you’re using a plugin that modifies the basic BP behavior. You might check to see that that plugin doesn’t unhook the bp_add_friend_button() from the member header. Otherwise, the friendship button appears in the member header in BP’s default themes.


    otty-dev
    Participant

    @ottiya

    @dcavins

    Correct, I added a plugin that replaces add friend with follow.
    I created a new directory of buddypress > members > single > cover-image.php and tried to add the following code but no luck:

    <div id="item-header-content">
                    
    <?php }else{?>
    <div class="follow_button">
    		<div class="follow_icon">
    		 			<?php
              $args = array('leader_id' => bp_displayed_user_id(), 'follower_id' => bp_loggedin_user_id(),);
              echo bp_follow_get_add_follow_button($args);
              ?>
    		</div>
    	</div><div class="clear_follow"></div>
    	<?php }?>

    Hi @ottiya-

    Right. With that plugin, I don’t think you should have to do anything. It hooks into the 'bp_member_header_actions' to generate the follow button in place of the friend button, so the default member header should work fine. I’d try having no overwrite template in place.

    If you’re still not seeing the “follow” button, deactivate the follow plugin and see if the “add friend” button is appearing as expected.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar