[resolved] Show Nickname as a Greeting (4 posts)

  1. rosemckay
    Posted 7 years ago #

    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.

  2. blackbookdesign
    Posted 7 years ago #

    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.

  3. 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!';
  4. rosemckay
    Posted 7 years ago #

    That worked like a charm, Otto thank you so much!

Topic Closed

This topic has been closed to new replies.

About this Topic