Im trying to create a staff directory to show all WP users to then allow you to click through and view their profile, similar to a standard custom post loop and then viewing a the single-{customPost}.php.

Below is the loop i have for my users but and iv created my template for the loop, but am struggling how to output the link to click through to view the user profile?


                // WP_User_Query arguments
                $args = array(
                    'order'          => 'ASC',
                    'orderby'        => 'id',

                // The User Query
                $user_query = new WP_User_Query( $args );

                // The User Loop
                if ( ! empty( $user_query->results ) ) {
                    foreach ( $user_query->results as $user ) { ?>
                    <li><a href="">User Name</a>

Read more here: Linking to a user profile in wp user query


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: