I put together this very simple snippet to display a user’s name when they log in to a premium membership site. Then, to display their name, all you have to do is use the shortcode [user_first_name], and their name will appear instead (assuming it has been entered in their profile).
You can take it a little further and modify this to show other information instead by taking advantage of the other variables available under $current_user. Use the following values to show more information:
- First name: user_firstname
- Last name: user_lastname
- Display name: display_name
- Username: user_login
- User email address: user_email
- User ID: ID