Skip to:
Content
Pages
Categories
Search
Top
Bottom

display recently registered users

  • @neoseeyou

    Participant

    Hello

    I found a function (http://www.wpbeginner.com/wp-tutorials/how-to-display-recently-registered-users-in-wordpress/) to display last registered users on a page.

    All is working good but i don’t know how to make a link for each user’s profile.

    I tried to modify the code given above like this :

    $recentusers .= '<li>' .get_avatar($username->user_email, 150).'<a href="'.bp_core_get_user_domain($user_ID).'">'.$username->user_nicename."</a></li>";

    But no success.

    Any help would be appreciate

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • @shanebp

    Moderator

    The sql call isn’t returning the user ID.

    Change the sql to:
    $usernames = $wpdb->get_results("SELECT ID, user_nicename FROM $wpdb->users ORDER BY ID DESC LIMIT 5");

    Then make this change:
    $recentusers .= '<li>' . bp_core_fetch_avatar( array( 'item_id' => $username->ID, 'type' => 'full') ) . '<a href="' . bp_core_get_user_domain($username->ID) .'">' . $username->user_nicename . '</a></li>';

    @neoseeyou

    Participant

    Wow thank you for your fast answer Sir.

    My php skills are too light 😉

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘display recently registered users’ is closed to new replies.
Skip to toolbar