Show Logged-In Usernames
-
I want to display the usernames of logged-in users, and found the below code to do so. However, if someone is not-logged in, I’d like to display a “Welcome Guest, Log-In or Sign Up” message.
I am no good with php, can somebody help?
<?php if (is_user_logged_in()){ global $current_user; ?> Hello, <strong><?php echo $current_user->first_name; ?></strong>! <?php } endif; ?>
Thank you!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Show Logged-In Usernames’ is closed to new replies.