Perfect! This DOES remove Subscriber users from the member directory. Such an easy fix. Thanks!
But how can one exclude administrator? What is his role[?]
never mind, I found
User Level 8 converts to Administrator
User Level 9 converts to Administrator
User Level 10 converts to Administrator
EDIT: No, it doesn’t work
How would you modify this to be just one group? I tried changing
if ( $user->roles[0] != ‘subscriber’ ) : to if ( $user->roles[0] = ‘moderator’ ) :
but it seems to still include everyone (or at least moderators as well as administrators – those are the only roles I’m currently using).
Thoughts?
Hello , I have 2 questions :
1. How do you include only subscribers ? It means I would like to have only subscribers directory and ignore other roles.
2. How do you exclude more roles as for example subscribers + editors + moderators ? it means how should look like a code for more than 1 role?
If you want to include just one role change
if ( $user->roles[0] != ‘subscriber’ ) :
to
if ( $user->roles[0] == ‘subscriber’ ) :
or
if ( $user->roles[0] == ‘moderator’ ) :
Yeah, how can I add member roles to the members loop?
For example this menu:
All members | Persons | Companys | Universitiys | Other
Hi there,
exactly looking for the same stuff!
thanks for this code, answers my next need in current BP project. in answer to last two questions, try this plugin I found: https://wordpress.org/extend/plugins/advanced-access-manager/ has allowed me to create custom BP roles recognized by BP core and other plug-ins like Justin Tadlock’s roles-at-registration, role-scoper, etc.