How to create member directory loop
-
Hello,
I am trying to figure out how to create a loop that will list all members within several specific membership levels. The current loop I have works for showing all members with certain meta keys/values however I need to add membership levels to the list. This is the loop I am using —<?php $blogusers = get_users (array( 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'custom_field_24' ), array( 'key' => 'custom_field_39', 'value' => 'yes' ), array( 'key' => 'first_name' ) ) )); foreach ($blogusers as $user) : ?> //my divs <?php endforeach; ?>And the loop that I think I need to use to access the membership levels, looks something like this —
$member_ids = $wpdb->get_col("SELECT user_id FROM $wpdb->memberships_users WHERE membership_id = '1'"); $level1users = get_users(array("include"=>$member_ids));
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘How to create member directory loop’ is closed to new replies.