May 4, 2009

Show Username of Logged-in User




standard-login-screen-large

If you want to show the username of a logged-in user in some place other than the meta sidebar widget that comes pre-loaded with WordPress, you can do so by placing the following code anywhere in your WordPress theme, and it will accomplish this simple task:

<?php global $current_user; if ( isset($current_user) ) {     echo $current_user->user_login; } ?>

Thanks Pro Blog Tutorials for this simple little WordPress hack!

Aweber Email Marketing

Related posts:

  1. How to Number Your Comments
  2. Show latest posts in the sidebar
  3. Display the total number of users of your WordPress blog
  4. Display Today’s Date on your Blog
  5. How to preset text in the WordPress post editor


Previous Post and Next Post


Try HostGator Webhosting for 1 cent for the 1st Month Click here and enter "wordpress"

Leave a reply

* means field is required.

*

*