Skip to:
Content
Pages
Categories
Search
Top
Bottom

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

  • Avatar of SimpleOne
    SimpleOne
    Participant

    @simpleone

    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)
  • Avatar of Ayman
    Ayman
    Participant

    @aymanalzarrad

    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;
    }
    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    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

    http://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/

    In the over-ride, remove this code:

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

    @simpleone

    @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.

    Avatar of mrjarbenne
    mrjarbenne
    Participant

    @mrjarbenne

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

    Avatar of SimpleOne
    SimpleOne
    Participant

    @simpleone

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

    Avatar of mrjarbenne
    mrjarbenne
    Participant

    @mrjarbenne

    Ahhh, of course. Sorry I misread.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.