What about putting the city/regions/whatever into an array you can loop through? Something like this:
$cities = array( 'Richmond', 'Chicago', 'New York' );
foreach ( $cities as $city ) { ?>
<h2><?php echo $city; ?></h2>
<ul><?php
foreach ( get_users_by_meta_data( 'school_division', $city ) as $user ) { ?>
<li><?php echo $user->first_name; ?> <?php echo $user->last_name; ?></li>
<?php } ?>
</ul><?php
}
Related Posts:
- mysql query two database tables, users and usermeta and sort by custom meta int value
- Difference between update_user_meta and update_user_option
- get_user_meta() doesn’t include user email?
- Automatically delete inactive users after 2 months
- How to display custom user meta from registration in backend?
- Allowing an email as the username?
- Grouping users under parent user
- How to create a template for a custom URI associated with the user
- How to order users alphabetically by their last name?
- Wp_User_Query not sorting by meta key
- How we can get the user id by its display_name
- WP_User_Query with combined meta query – not working?
- How to use hyperdb to separate and share a user dataset between wordpress installs?
- LEFT JOIN, INNER OUTER JOIN, LEFT OUTER JOIN is driving me crazy. Please help?
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- How to add follow functionality to multi-author wordpress site?
- Search multiple meta keys at once
- Where to Store Custom User Fields
- Plugin that would allow WordPress Authors to “follow” other Authors and query “Activity Info” from that
- Querying Email Addresses for a List of Users with Same Last Name?
- Showing user ID on user main page from screen options
- Front end user meta options for users
- ACF Upload Image in front-end with custom form
- Drop down list in user profile page
- Searchable meta value in user.php
- How to add country drop down menu to the user profile?
- Add custom fields to the user profile
- stop login if user_status equal zero
- Does wp_delete_user() remove all user content?
- WP User Query fails when searching meta queries and search columns
- How can i create an array user meta?
- How to set show admin bar front to true for all users?
- Add user data to table when user is created?
- Updating user meta
- Get all user meta by meta key instead of ID
- How to get a list of all possible values of a specific user meta key?
- Use wp_update_user to update custom column in wp_users table
- Are User Levels Still Currently Used?
- WPML Default Language User Meta [closed]
- Display users in order by an “order” custom meta field
- Search Users base on meta_value & meta_key
- Rest API code to get ID of current user not working: get_current_user_id() gives 0
- Updating wp_user_level on user update
- User Meta Data in a Sortable Table
- get_user_meta an ID for multiple functions
- How can I attach a user to another user with user meta
- Column Sorting Code on users.php
- Creating user without username and password
- Is this code true or not
- WordPress SQL Issue not returning correct reselts
- The Simple and Correct Way to Add User Meta
- How to pull all the contributer users records and order by Designation (which is users meta data)?
- cannot get user_registered date from get_user_meta
- how to set default update_user_meta values wordpress
- Get user by meta key – WP multi site
- Add custom user meta data
- Cannot Update user meta in custom field
- Can I Create a Second Admin Level User Role?
- How to add an attribute to a user?
- Adding fields to the “Add New User” but the form data not saved into DB
- New User Save Filter
- SELECT from wp_users, get Displayname too
- Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?
- how do I add role and capability after I create a new user
- User Meta stuff
- What does “link” refer to when you delete a user?
- How do I update user email from frontend input field?
- Can I add a unique code for each user based on the location?
- My custom user metadata is only active for only admin but i want it to be active on all users especially customers
- How to get image path from id using SQL
- Update user role for expired membership
- Getting user data via ajax
- How can i add user display name drop down menu in frontend?
- Store data from JavaScript object to custom table in user account
- Hook into add_user_role and update based on new and removed roles
- How to prevent multiple user accounts with the same meta field?
- How to Moderate Edits to User Profiles?
- How to change the value of a variable using input field?
- meta_query orderby sort multiple keys
- How to update user meta from php file?
- In admin manage users page, how can I stop users with certain privileges from editing users with other privileges?
- Get meta key with value for user
- user and usermeta table not found
- Private messaging – Getting and displaying the avatar/url of a message recipient
- Updating custom user meta
- Require confirmation of current user’s email before updating database and before send_email_change_email
- UserMeta Changes Meta Value for Post ID
- Store extra user values permanently
- How do I change the user via SQL?
- Username has been exposed
- User list order by user meta
- Get author meta of all writers
- Let users register weight each day and save it in DB
- Sort users by custom user meta value
- Problem with update_user_meta() meta_value
- Import users and custom user meta from csv
- Add custom input field in new user page
- WordPress – Security Question at Login from User’s Meta Data
- MySQL query to list users who never signed in
- Export user data from Squirrly’s Starbox plugin?