I managed to put the username in like this:
<?php
global $current_user;
if ( isset($current_user) ) {
echo $current_user->user_login;
}
?>
Here is a nice example I came up with.
<?php if (is_user_logged_in()){
global $current_user; get_currentuserinfo();
echo('Welcome, ' . $current_user->user_firstname . ' | ');
}
else {
echo "Welcome, Visitor | ";
};
?>
The
user_firstname
can be changed to a number of things. See:Function_Reference/wp_get_current_user
Comments
Post a Comment