rosemckay
Member
Posted 3 years ago #
Hello,
I'm wondering if there is a template tag or other way to create a greeting to site visitors after they have logged in. For example "Welcome Back NickName!" Where the nickname is the user's.
I've looked through the list of tags but I don't see any, any help would be appreciated. Thanks.
blackbookdesign
Member
Posted 3 years ago #
http://wordpress.org/extend/plugins/wp-greet-box/
This could be useful.
I haven't been able to find the tag either....
You could check for a register plug-in and copy their code as well.
sorry for the poor help.
This bit of PHP will do the trick in a theme or something.
if (is_user_logged_in()) {
// user is logged in, say welcome back
$user = wp_get_current_user();
echo 'Welcome back '. $user->display_name . '!';
} else {
// user is not logged in
echo 'Hello Mr. Anonymous!';
}
rosemckay
Member
Posted 3 years ago #
That worked like a charm, Otto thank you so much!