I would like to have the header of my site reading "Logged in as " when a user is logged into my wordpress site.
I dont know how to echo the username of the current user, heres the code I'm got...
<?php
if ( is_user_logged_in() ) {
echo '<ul id="mem" class="clearfix">
<li><a href="#">Logged in as Username</a></li>
<li><a href="#">Logout</a></li>
</ul>';
} else {
echo '<ul id="mem" class="clearfix">
<li><a href="#">Register</a></li>
<li><a href="#">Login</a></li>
</ul>';
}
?>
and I'd like to replace Username.
Any help is much appreciated.
Thanks,
Mark
you can use get_currentuserinfo() function to grab any logged in users info..
in your case it could be
:)