Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • mattvd
    Participant

    @mattvd

    Hi everyone,

    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[0] != 'editor' )
    To say greater than editor?


    mattvd
    Participant

    @mattvd

    Brilliant! Thanks so much!


    mattvd
    Participant

    @mattvd

    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.

    http://postimg.org/image/ay8fbd23f/

    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[0] != '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; ?>

    mattvd
    Participant

    @mattvd

    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?


    mattvd
    Participant

    @mattvd

    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.


    mattvd
    Participant

    @mattvd

    Please let me know if you find anything out about this. My website is contingent on this feature…


    mattvd
    Participant

    @mattvd

    I cant quite get the code to work…. I don’t know why it is being stripped? I tried putting it within code and pre tags… anyways, here is the screenshot of the code:

    http://oi48.tinypic.com/2hp6p1i.jpg

Viewing 7 replies - 1 through 7 (of 7 total)
Skip to toolbar