How to display name of logged in user
-
Please help me, how to display the name of the logged in user in my header and customize it?
I’ve found this code:
<?php
if ( is_user_logged_in() ) {
global $current_user;
get_currentuserinfo();
echo ‘You are logged in as: ‘ . $current_user->user_login;
} else {
echo ‘you are not logged on’;
};
?>
It works but I don’t know how to place it in the desired place (e.g. I’d like it to appear in the upper right corner, also I need to change the colour of the text as it is almost invisible due to the background colour).
Or is there any simpler way how to display the name of the logged in user?
Thank you very much for your help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to display name of logged in user’ is closed to new replies.