WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. rosemckay
    Member
    Posted 5 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.

  2. blackbookdesign
    Member
    Posted 5 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.

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    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
    Member
    Posted 5 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