Display Recently Registered Users on WordPress

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. <ul class="recently-user">
  2. <?php $usernames = $wpdb->get_results("SELECT user_nicename, user_url FROM $wpdb->users ORDER BY ID DESC LIMIT 5");
  3. foreach ($usernames as $username) {
  4. echo '<li>' .get_avatar($username->comment_author_email, 45).'<a href="'.$username->user_url.'">'.$username->user_nicename."</a></li>";
  5. }
  6. ?>
  7. </ul>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.