May 4, 2009

Show Username of Logged-in User


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!

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.