Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Display first name instead of username

Change global $userdata,$user_identity; to global $userdata, $current_user, $user_identity;

Then change

echo '<div class="login">' . $before_widget . $before_title . "Welcome ".$user_identity . $after_title . '</div>';

to

echo '<div class="login">' . $before_widget . $before_title . "Welcome ".$current_user->user_firstname . $after_title . '</div>';

You can see all the info in the codex : http://codex.wordpress.org/Function_Reference/get_currentuserinfo

Related Posts:

  1. Private page protected with username and password
  2. Lock out all WordPress Administrators except two specific users
  3. Invalidate username if it contains @ symbol
  4. WordPress not logged in locally with correct username and password
  5. Make WordPress User Name be the Company Name when Registering (not the default ‘first name’ last name’ email address’)
  6. User login without username, only password
  7. Cannot login with correct username and password anymore
  8. Username character requirements
  9. In Django, how do I know the currently logged-in user?
  10. Can I programmatically login a user without a password?
  11. Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
  12. Is there any way to rename or hide wp-login.php?
  13. How to login with email only no username?
  14. How can I redirect user after entering wrong password?
  15. Increase of failed login attempts, brute force attacks? [closed]
  16. Login page ERROR: Cookies are blocked due to unexpected output
  17. Separate registration and login for different roles
  18. SSO / authentication integration with external ‘directory service’
  19. Preventing session timeout
  20. How reduce wordpress login session timeout time?
  21. How to prefill WordPress registration with social details
  22. Check for correct username on custom login form
  23. Disallow user from editing their own profile information
  24. I can’t access my site via wp-admin
  25. ‘Password field is empty’ error when using autofill in Chrome
  26. Removing username from the ‘wordpress_logged_in’ cookie
  27. How to show ‘login error’ and ‘lost password’ on my template page?
  28. What is $interim_login?
  29. Custom login form
  30. How to prefill the username/password fields on the login page
  31. wp_signon returns user, but the user is not logged in
  32. Adding extra authentication field in login page
  33. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  34. Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
  35. wp_signon() does not authenticate user guidance needed
  36. What exactly is ReAuth?
  37. What are the differences between wp_users and wp_usermeta tables?
  38. Login members using web services
  39. Make my wordpress blog remember my login “forever”
  40. How to check in timber if user is loggedin?
  41. How do I change the language of only the login page?
  42. Disable WordPress 3.6 idle logout / login modal window / session expiration
  43. Stop WordPress from logging me out (need to keep me logged in)
  44. Woocommerce registration page [closed]
  45. How to disable autocomplete on the wp-login.php page
  46. Share login data/cookies between multiple installations
  47. Synchronize WordPress user accounts across multiple domains and installations without using WordPress MU
  48. How to pass users back and forth using session data?
  49. How do I change the logo on the login page?
  50. Why does WordPress hide the reset password key from the URL?
  51. Is it possible to sign in with user_email in WordPress?
  52. How to use current_user_can()?
  53. Avoid to load default WP styles in login screen
  54. WordPress registration message
  55. How to fake a WordPress login?
  56. how to display the wordpress login and register forms on a page?
  57. Does wp_logout_url() destroy a session? (Logging out question)
  58. How can I send a welcome email to a user AFTER they login for the first time?
  59. Can not login with correct username and password
  60. Website Visible only to Registered users
  61. How can i increase the login expiration length?
  62. How do I use add_action from a class method?
  63. How to remove the WordPress logo from login and register page?
  64. How can I add a custom script to footer of login page?
  65. Brute force attack?
  66. Customize wp_new_user_notification_email()
  67. Need to execute a cron job
  68. Login email after registration never sent or received
  69. How can I create a separate blog that is private?
  70. How to keep always logged in development environment
  71. Add Confirm Password field in wp-login.php Password Reset page
  72. Integrate recaptcha and wp_signon – what is needed?
  73. Stop users from logging in from multiple locations
  74. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  75. custom login page redirect to logged in user profile page
  76. Email address or username used to login in wordpress
  77. How do I check if a post is private?
  78. Front-end login: Redirect user to the post they had created
  79. Receiving “This content cannot be displayed in a frame” error on login page
  80. My login form does not work
  81. Programmatically log in a wordpress user
  82. Action wp_login_failed not working if only one field is filled out
  83. Getting “Cookies are blocked or not supported by your browser” on login page
  84. What is the purpose of logging out after WordPress upgrade?
  85. Is it alright for two people to simultaneously be logged into a WP site as administrator?
  86. wp-login.php redirecting to HTTPS
  87. Display last login time
  88. How to customise wp-login.php only for users who are setting a password for the first time?
  89. Pre-populate Username Field
  90. Intentionally Force Failed Login WordPress
  91. How do I turn off the ability to login?
  92. Gaining Login Access via the Database
  93. How can I test the login for an expired session?
  94. Give visitor access to password protected page/post via external script
  95. add the user name to menu when user is logged in [closed]
  96. Send reset password link to user from custom lost password form
  97. What hooks should I use for pre-login and pre-registration actions?
  98. WordPress Login Footer URL
  99. Remove built in wordpress login and use only google auth
  100. Websites defaced by uploading script using theme editor
Categories login Tags login, username
ecommerce plugin with “buy for a friend” feature [closed]
How to execute a plugin on a single page only?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress