• Resolved Gustav

    (@4ever16)


    $user_id = $url;
    $test = get_user_meta( $user_id->ID, 'description', true );
    echo $test;

    Row 1: $url is username/nicename of that specific user.
    Row 2: trying to get description.
    Row 3: printing description.

    There is a problem with row 2 i understand that sow what is the correct way?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey!

    Assuming $url is their username for that user, try this:

    $user = get_user_by('login', $url);
    $test = get_user_meta( $user->ID, 'description', true);
    echo $test;
    Thread Starter Gustav

    (@4ever16)

    Solved it thanks for the help.

    This solution is for nicename not log in name.

    $user = get_user_by('slug', $url);
    $test = get_user_meta( $user->ID, 'description', true);
    echo $test;
    • This reply was modified 5 years ago by Gustav.
    • This reply was modified 5 years ago by Gustav.

    OK great 🙂 No worries.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get user description by username with argument’ is closed to new replies.