• Resolved heyrsmith

    (@heyrsmith)


    I would like to have a “logged in as: whatever-user-has selected-for-how-to-display” located above (or near) the logout option in my sidebar. So, when logged in, it looks something like:

    Site Admins (link to dashboard that shows up when logged in)
    Logged in as: Name
    Log Out

    If it is easier, just some code to put anywhere to show the logged-in user would be cool too.

    Thanks in advance for any help…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Found this thread that may interest you:
    http://wordpress.org/support/topic/40050

    ********************
    Welcome to the WordPress Support Forums!

    Please help keep the Forums successful by reading:
    Using the Support Forums

    Also, remember the WordPress Codex and the FAQ pages.

    And, thank you, for letting us know if this information proves useful (or not)!
    ********************

    Thread Starter heyrsmith

    (@heyrsmith)

    Huge, Huge help Michael – thanks a million. In my searches I could not find anything close. Here is what I put together:

    <!-- "write a new post" link if logged in -->
    <?php global $user_login; get_currentuserinfo();
    if ($user_login) :?>
    <li><a href="/wp-admin/post.php">Write a New Post</a></li>
    <?php endif; ?>
    <!-- register,login/logout links -->
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?>
    <?php global $user_login, $user_identity;
    get_currentuserinfo();
    if ($user_login); ?>
    <?php echo $user_identity; ?>
    </li>

    Works like a charm, and I even learned how to add a direct link to the “Write Page” er, page. Again a million thanks.

    Thanks for copying that code over here, heyr. That was useful for one of my blogs. I just used the part,
    <?php global $user_login, $user_identity;
    get_currentuserinfo();
    if ($user_login); ?> Welcome
    <?php echo $user_identity; ?> !

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show “Logged in As:” in the side bar’ is closed to new replies.