How To Display Recently Registered Users on WordPress


Sponsored Links




With little bit functions Display Recently Registered Users on WordPress with Gravatar is easy, we only need to write down little bit of code and the result will be displayed. This code is original resource from WP Recipes, we only tweak it little bit.

Display Registratered Users on WordPress with Gravatar


Code to Display Recently Registered Users

<ul class="recently-user">
	<?php $usernames = $wpdb->get_results("SELECT user_nicename, user_url FROM $wpdb->users ORDER BY ID DESC LIMIT 5");
		foreach ($usernames as $username) {
    			echo '<li>' .get_avatar($username->comment_author_email, 45).'<a href="'.$username->user_url.'">'.$username->user_nicename."</a></li>";
		}
	?>
</ul>

Please note this code still using directly SQL Query method, if you have better method by using WordPress API resource please let’s me know. And let’s me fix the code to display recently registered users in wordpress with Gravatar. I hope this code useful for you.

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

How to Add user_registered Column in Authors & Users Page on wp

then I found the code regarding how to display the users list not supported for adding new column using WordPress hook/filter. Well, the plugin is: Recently Registered. Read More

List WordPress Users - Custom Query » Matt Varone

Learn how to list your WordPress users with a custom query I recently had been working in a site with a CMS And to display the users in rows you could float the li items Read More

WordPress.com — Get a Free Blog Here

Free blogs managed by the developers of the WordPress software. Includes custom design templates, integrated statistics, automatic spam protection and other features. Read More

How to Allow Users to Add Favorite Posts in WordPress

How to allow users to add favorite posts in WordPress, so you can create a Recently, while working on a membership whether you want to have this for registered users Read More

Displaying Author Meta Information in Wordpress 2.8 | Build Internet

Especially if your site has registered users, this is an meta() tag is only meant to be used to display Let the rest of us recently upgraded WordPress fiends in on it too! Read More


8 Responses to How To Display Recently Registered Users on WordPress

  1. This calls for some type of style to be called to make it look beter. Can you post that info too? I added this to my site but it looks like poop.

  2. Shoot. I forgot to subscribe to thread via email. Sorry for double post.

  3. I forgot a 2nd time to subscribe to post. :(
    I’m looking for a way to display recently registered users and their avatars more like avatar is abs middle to the username. can you help me do this?

    • WP Tricks says:

      Hu Awesome Links

      To display Some user info with their avatar is easy too. If you want display on single page (single.php) tried this method

      <?php
          $post_author_name=get_the_author_meta("display_name");
          $post_author_description=get_the_author_meta("description");      
      
          $html="<div class='clearfix' id='about_author'>\n";
          $html.="<div class='img-shadow'><img width='80' height='80' class='avatar' src='http://www.gravatar.com/avatar.php?gravatar_id=".md5(get_the_author_email()). "&default=".urlencode($GLOBALS['defaultgravatar'])."&size=80&r=PG' alt='PG'/></div>\n";
      
          $html.="<div class='author_text'>\n";
          $html.="<h4>Author: <span>".$post_author_name."</span></h4>\n";
          $html.= $post_author_description."\n";
          $html.="</div>\n";
          $html.="<div class='clear'></div>\n";
          $html.="</div>";
          $content .= $html;
       ?>

      I hope this trick worked on you

  4. Pingback: How To Display Specific Content for Admin Only in WordPress # WordPress Tricks & Tips

  5. wphax says:

    Simple code, exactly what I was looking for. Thank you!

    :)

  6. Pingback: WordPressに最近登録したメンバーのアバターを列記する方法 | まちいく

  7. emt tips says:

    [...] How To Display Recently Registered Users on WordPress # WordPress Tricks & Tips [...]

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>