Warning: mysqli_query(): (HY000/1030): Got error 28 from storage engine in /home/wpthemes/public_html/wp-includes/wp-db.php on line 1877
Show Username of Logged-in User | WPThemes.com - WordPress Themes
Warning: mysqli_query(): (HY000/1030): Got error 28 from storage engine in /home/wpthemes/public_html/wp-includes/wp-db.php on line 1877

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!


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.

*

*