How to Display and Order Users on a Page

If you have registered users on certain role, to list them on a single page, you can use WP_User_Query

Here’s the basic loop:

You can list and order the result by adding array value, in below example I would like to order user by last name, the $arg array value should like:

That’s it let me know if you have any questions.

PHP, snippet, Wordpress, , Leave a comment