Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Hiding a member


invertedsphere
Participant

@invertedsphere

I have a solution:

You need to edit the buddypress members loop file located probably at /wp-content/themes/bp-themes/bp-sn-parent/directories/members/members-loop.php

Find the members loop and make it look something like this:

<?php while ( bp_site_members() ) : bp_the_site_member(); ?>

<?php // put member name into variable

ob_start();

bp_the_site_member_name();

$excluded_user = ob_get_contents();

ob_end_clean();

?>

<?php if($excluded_user != ‘name of user goes here’) { ?>

// ORIGINAL CONTENTS OF LOOP GO HERE

<?php } // end if $excluded_user !=… ?>

<?php endwhile; ?>

Note that this will compare the name that the user entered in their profile, not to be confused with the login name. It would probably be best to give the user a complex name that nobody else would likely use so that you don’t accidentally hide unsuspecting users. Maybe you can figure out how to get the actual login name though.

Good luck to all

Skip to toolbar