Skip to:
Content
Pages
Categories
Search
Top
Bottom

hide admin from members list

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    You mean you don’t want the Admin to be included in the list of members in members directory?

    Avatar of oblax
    oblax
    Participant

    @oblax

    Exactly. How can I do it? I googled it and I could find any.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    You may want to try this code

    http://pastebin.com/phUXcaDN

    hope that helps.

    Avatar of Keats18
    Keats18
    Member

    @keats18

    Brajesh I am looking to do the same thing, where do you place that code? I tried members loop but no luck

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    You would normally add the code in your theme’s functions.php file

    Avatar of wordpressagentur
    wpagentur
    Participant

    @wordpressagentur

    Hi, i put the code in my theme funktions.php but superadmin is still visible in memberslist.

    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 searching for friends list etc?, do not exclude in this case
    if(!empty($args['user_id'])||!empty($args['search_terms']))
    return $qs;

    if(!empty($args['exclude']))
    $args['exclude']=$args['exclude'].’,’.$excluded_user;
    else
    $args['exclude']=$excluded_user;

    $qs=build_query($args);

    return $qs;

    }

    Iam using WP: 3.5.1 and BP: 1.7.2 with the buddyboss-theme.

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

You must be logged in to reply to this topic.