WordPress.org

Ready to get started?Download WordPress

Forums

Am I logged in? (7 posts)

  1. luthien01450
    Member
    Posted 9 years ago #

    It seems that there's no real way to tell if you are logged in to the Blog site and who you are logged in as.
    Is there a plugin/hack available that will do something like this in the Other section?
    If user is not logged in, nothing needs to change. Login and register links both show up.
    If user is logged in, change this section to say something like Hello {username}! and have a logout link.

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    If the user is logged in, they will see the inner workings of WordPress surely ?
    ..and there is a log out link on the right ...

  3. Root
    Member
    Posted 9 years ago #

    Thats right. A minor useability detail but it might be nice. I' d also like a Comment mod on / off on my front page but I havent got it fixed up yet.

  4. wyzewoman
    Member
    Posted 9 years ago #

    I put this in my index.php file, where I want the "hello USERNAME" to show up:

    get_currentuserinfo();
    if (isset($user_ID) && ('' != intval($user_ID)))
    {$hello='Welcome ';
    $hello.=$user_nickname;
    $hello.='<br>';
    echo $hello;}

  5. luthien01450
    Member
    Posted 9 years ago #

    Thanks, it appears I don't know enough about php to successfully add this to index.php however. When I copy and paste it, the site breaks.

  6. prophet6
    Member
    Posted 9 years ago #

    That's because you have to replace the && for &&. So, try this:

    get_currentuserinfo();
    if (isset($user_ID) && ('' != intval($user_ID)))
    {$hello='Welcome ';
    $hello.=$user_nickname;
    $hello.='<br>';
    echo $hello;}

  7. xircom
    Member
    Posted 9 years ago #

    if you look at your posts on your blog, you'll notice an 'edit this' link in the post meta if you are logged in. doesn't tell you WHO, but it does tell you IF.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.