I am new at WordPress. I have need to display current user info on page: avatar, name, lastname, login... I have spent several hour on web, but could not find clean solution: How is it possible to do this in WordPress?

Thank You

  • 1
    You might want to remove the request for a plugin recommendation, if you don't want your post to be closed, as they are off-topic. – vancoder Mar 12 at 23:49

WordPress has wp_get_current_user() function for getting the current (logged in) user, which you could use. If the returned WP_User object doesn't have all the details you need, you can get either all or a specific user meta with get_user_meta(). For getting the user's avatar, you could use get_avatar().

Have a look at the function docs for more details and their User Contributed Notes for some usage examples.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.