• Resolved contact2vvl

    (@contact2vvl)


    Hi!

    I want to link to the user profile, based on their name. I have a list of users (name and profile pictures), but the code I use does not link to the user profile uid url, but to another url. Users can add their website to their profile, and this code does link to the url they added to their profile.

    <a href="<?php echo esc_attr($user->user_url); ?>"><?php echo $user->display_name; ?></a>

    Is there any way to link to their profile page?

    Thanks in advance!

    • This topic was modified 2 years, 10 months ago by contact2vvl.
    • This topic was modified 2 years, 10 months ago by contact2vvl.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter contact2vvl

    (@contact2vvl)

    • This reply was modified 2 years, 10 months ago by contact2vvl.
    Thread Starter contact2vvl

    (@contact2vvl)

    <a href="<?php echo esc_attr($user->user_url); ?>"><?php echo $user->display_name; ?></a>

    Plugin Author ProfileGrid Support

    (@profilegrid0)

    Hello @contact2vvl,

    Thank you for reaching out to us.

    You may use the below code to get the user profile URL of a user. Here,$user->ID is the ID of the user.

    $pmrequests = new PM_request;
    $profile_url =
    $pmrequests->profile_magic_get_frontend_url(‘pm_user_profile_page’,”);
    $profile_url = add_query_arg( ‘uid’,$user->ID,$profile_url );

    I hope this helps, let us know if you have any other questions.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get user url via PHP’ is closed to new replies.