List of the last registered users • WordPress Help

 users wordpress

If you have an important community every element that makes the sense of belonging is vital, and you should not waste any opportunity of that the users of your site feel integrated .

This, with a BuddyPress installation, is simple, since it offers widgets of all kinds to show groups, users connected or new users, but what happens in a WordPress " normal "? without additions.

One of the vital elements for fidelizar generate conversation and community is to show a list of new users, of the last ones that have registered and for it you only have to add a small code to your sidebar (for example), something like this: [19659006] Newcomers

get_results ("SEL ECT user_nicename, user_url FROM $ wpdb-> users ORDER BY ID DESC LIMIT 5 ");
        foreach ($ usernames as $ username) {
                echo '

  • ' .get_avatar ($ username-> comment_author_email, 45). '

      ] The newcomers

      <? Php $ usernames = $ wpdb -> get_results ( "SELECT user_nicename, user_url FROM $ wpdb-> users ORDER BY ID DESC LIMIT 5" ) ;

      [19659021] foreach ( $ usernames as $ username ) { echo '

    • ' . get_avatar ( $ username -> comment_author_email 45 ) . '< a href = "'. $ username -> user_url . '"> '. $ username -> ] ; ; ; ]

  • What makes this code, apart from giving a title to the block (the defined by h3 ), is to retrieve the list of users and display the last 5 registered, then display them by their username chosen in the WordPress profile, next to their gravatar in a decent size (45), which is not too big, and with the name linked to its author page, there is nothing.

    Nice trick shared by emobot

    NOTICE : this publication is from two years ago or plus. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

    Loading …

    That may also help you: