Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display only members who have uploaded avatar


  • evo252
    Participant

    @evo252

    Hi,

    I have this loop on a custom page template that displays 6 custom members:

    
    if ( bp_has_members( 'type=random&max=6' ) ) : 
          while ( bp_members() ) : bp_the_member();
                bp_member_avatar('type=full&width=125&height=125')
          endwhile;
    endif;

    Is there a way to customize this loop for having only members who have uploaded a photo as avatar?

    Thank you.

Viewing 1 replies (of 1 total)
  • Hello Evo252,

    You should try this trick https://gist.github.com/imath/5083281

    The trick will first add (as soon as you go in your WordPress Backend) a user_meta “evo_user_uploaded_avatar” to all the users that have uploaded an avatar thanks to the init function init_evo_meta() (don’t forget to delete lines 50 to 73 once ran) .

    Then from now on functions evo_user_uploaded_avatar and evo_user_deleted_avatar will manage your users avatar uploads.

    !Important:

    I suggest you to first test it on a local dev environment, I also suggest that before uncommenting lines 67 and 68 you make a db back up.

    Finally Once you ran the init_evo_meta() function, i suggest that you delete lines 50 to 73

Viewing 1 replies (of 1 total)
  • The topic ‘Display only members who have uploaded avatar’ is closed to new replies.
Skip to toolbar