• Hello,

    I want to be able to implement this:

    Hello (person username here if he is logged in)!

    OR

    Hello Guest!

    “Guest” if the person is not logged in.

    How? I did so many searches, didn’t find anything 🙁

Viewing 7 replies - 1 through 7 (of 7 total)
  • Is there anyway to show FIRSTNAME LASTNAME rather than username?

    I managed to put the username in like this:

    <?php
    global $current_user;
    if ( isset($current_user) ) {
        echo $current_user->user_login;
    }
    ?>
    tationline

    (@tationline)

    Hello,

    I am a newbie and want to implement this function in my blog.
    I was hoping, that there was a plugin for that function, so that I do not have to modify files … but I couldn’t find any.

    In which file(s) do I have to add the above code?
    (I couldn’t find a “how to” for this …)

    In which file(s) do I have to add the above code?

    Where do you want it to go on your site?

    supermario290

    (@supermario290)

    Hey, this is exactly what I needed. Thanks lot moshu and krushinfo for the link and code. 🙂

    clickforward

    (@clickforward)

    Here is a nice example I came up with.

    <?php  if (is_user_logged_in()){
    global $current_user; get_currentuserinfo();
    echo('Welcome, ' . $current_user->user_firstname . ' | ');
    }
    else {
    echo "Welcome, Visitor | ";
    };
    ?>

    The user_firstname can be changed to a number of things. See: Function_Reference/wp_get_current_user

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to show the username of whos logged in?’ is closed to new replies.