Forum Replies Created
Thanks for all of your help! Now my next question is, is it possible to display all members with the role greater than editor? I’m not a php coder (as you can tell)
But could we modify this snippet?
if ( $user->roles != 'editor' )
To say greater than editor?
Hi henry thanks for all of your help.
I think I have the code somewhat working, at least it says up top viewing members 1 of 5 (I have 1 member assigned as editor). But it doesn’t pull anything like their avatar and name etc.
Here is my code (the part that you recommended)
<ul id="members-list" class="item-list" role="main"> <?php while ( bp_members() ) : bp_the_member(); ?> <?php $user_id = bp_get_member_user_id(); $user = new WP_User( $user_id ); if ( $user->roles != 'editor' ) break; ?> <li> <div class="item-avatar"> <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a> </div> <div class="item"> <div class="item-title"> <a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a> <?php if ( bp_get_member_latest_update() ) : ?> <span class="update"> <?php bp_member_latest_update(); ?></span> <?php endif; ?> </div> <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div> <?php do_action( 'bp_directory_members_item' ); ?> <?php /*** * If you want to show specific profile fields here you can, * but it'll add an extra query for each member in the loop * (only one regardless of the number of fields you show): * * bp_member_profile_data( 'field=the field name' ); */ ?> </div> <div class="action"> <?php do_action( 'bp_directory_members_actions' ); ?> </div> <div class="clear"></div> </li> <?php endwhile; ?>
Thank you henry! Now how can I implement that into my site? Do I have to create a new php file add the code that will display editors to create a new page that outputs only editors?
Thanks for your help!
So that will still output all members, but just add a note saying which ones are editors, correct? I would still like to have however a /members page that works right out of the box displaying all members. Just would like a separate page showing only editors.
Please let me know if you find anything out about this. My website is contingent on this feature…