Hey i have a custom page displaying all my members and i want to display their membership level label next to their name.
I use a query to catch my members, something like this
if (!empty($users)) : foreach ( $users as $user ) : $userdata = get_userdata( $user->ID ); $resume_attach_id = get_user_meta($user->ID, 'resume_attach_id', true); $resume_url = wp_get_attachment_url( $resume_attach_id ); $resume_title = get_the_title($resume_attach_id); $street_address = get_user_meta($user->ID, 'street_address', true); $postal_code = get_user_meta($user->ID, 'postal_code', true); $city = get_user_meta($user->ID, 'city', true); $google = get_user_meta($user->ID, 'googleplus', true); $linkedin = get_user_meta($user->ID, 'linkedin', true); $facebook = get_user_meta($user->ID, 'facebook', true); $skype = get_user_meta($user->ID, 'skype', true);
I’ve read the documentation on how to display a membership label with the “S2MEMBER_CURRENT_USER_ACCESS_LABEL” but of course it not apply for this case because it actually display my membership label as loggedin user.
Does anyone can explain me how to display the level for each of my members on the list ? is there something to do with the get_userdata function on WP ? thanks for your help