Linking to a user profile in wp user query

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?

<?php

                // 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>
                    </li>

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

Leave a Reply

Your email address will not be published. Required fields are marked *