Skip to:
Content
Pages
Categories
Search
Top
Bottom

Member Directory – how to remove 'Add Friend', 'Cancel Friendship' buttons?

  • @simpleone

    Participant

    How do I go about preventing the following buttons from being displayed on the Member Directory page?

    -Add Friend
    -Cancel Friendship
    -Friendship Requested

Viewing 6 replies - 1 through 6 (of 6 total)
  • @aymanalzarrad

    Participant

    One of the ways to do it is with CSS.
    You need first to find the class of the target button and then hide it with something like

    .class-button{
             display:none;
    }

    @shanebp

    Moderator

    In your theme dir, create an over-ride of this file.
    buddypress\bp-templates\bp-legacy\buddypress\members\members-loop.php

    How to over-ride a BP template

    Theme Compatibility & Template Files

    In the over-ride, remove this code:

    <div class="action">
    	<?php do_action( 'bp_directory_members_actions' ); ?>
    </div>

    @simpleone

    Participant

    @shanebp that worked! It was quick and easy since I had already made some previous changes to the members-loop.php file (which I’ve placed in a child theme folder). When I posted my question here, I wasn’t sure what to look for inside that file as I hadn’t seen any code reference to ‘button’ or ‘friend’. So thanks a bunch for pointing me to exactly what I needed to remove!

    @aymana I appreciate your suggestion too.

    @mrjarbenne

    Participant

    In the BuddyPress settings, you could just turn off the Friend component.

    @simpleone

    Participant

    @mrjarbenne that’s true, but I want the Friend functionality to be in place… just on the member profile pages, though.

    @mrjarbenne

    Participant

    Ahhh, of course. Sorry I misread.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Member Directory – how to remove 'Add Friend', 'Cancel Friendship' buttons?’ is closed to new replies.
Skip to toolbar