Adding a logged in user’s name
-
I dont’ know if this is the right place to post but I am a total newbie to php and need some help.
I am using wordpress and a plugin known as admin menu for it.
my site is at https://www.jessas.com/blog/I would like to be able to add the following to the that menu (which is like a bar right at the top of the page).
if a guest comes then welcome guest and ask them to register. and if someone is registered then to say welcome “username”
I have figured out which file (sem-admin-menu.php) and where to add the welcome. but can’t figure out how to get the name from the database and add it to the file.
On line 130 i have added welcome and then after that I think is where I would need to call the information.
I would really appreciate all the help I can get.
On a sidenote: I found the following script and tried it and it works in my sideabar.php file but don’t know how to implement it to the sem-admin-menu.php file.
\
<?php global $user_nickname;
get_currentuserinfo();
if ( $user_nickname<> “” ) { ?>
Welcome <?php echo $user_nickname ?>.
<?php } else { ?>
Welcome Guest<?php } ?>
\
- The topic ‘Adding a logged in user’s name’ is closed to new replies.