Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • philipstancil
    Participant

    @philipstancil

    Thanks for that, Shane! Perfect!

    I appreciate it.


    philipstancil
    Participant

    @philipstancil

    Hey Matt (merosler)!

    I added the code to my child theme’s functions.php file. If you aren’t using a child theme, you should be able to simply add it to your active theme’s functions.php file.

    Hope that helps!


    philipstancil
    Participant

    @philipstancil

    Crazy that we both found this old thread within 12 hours of each other. I got it working with this code:

    // Remove admin from directory
    
    add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
    function bpdev_exclude_users($qs=false,$object=false){
     //list of users to exclude
     
     $excluded_user='1';//comma separated ids of users whom you want to exclude
     
     if($object!='members')//hide for members only
     return $qs;
     
     $args=wp_parse_args($qs);
     
     //check if we are listing friends?, do not exclude in this case
     if(!empty($args['user_id']))
     return $qs;
     
     if(!empty($args['exclude']))
     $args['exclude']=$args['exclude'].','.$excluded_user;
     else
     $args['exclude']=$excluded_user;
     
     $qs=build_query($args);
     
     return $qs;
     
    }
    
    //Remove admin from member count
    
    add_filter('bp_get_total_member_count','bpdev_members_correct_count');
    function bpdev_members_correct_count($count){
    $excluded_users_count=1; //change it to the number of users you want to exclude
    return $count-$excluded_users_count;
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar