Show Username of Logged-in User

By | May 4, 2009

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!