WordPress.org

Ready to get started?Download WordPress

Forums

See if a user is logged in? (4 posts)

  1. Basically, I want to display a cached version of the blog if the user isn't logged in and an uncached version if they are logged in.

    The only thing I can't figure out what to do is how to test to see if the user is logged in. Help?

  2. Jennifer Ledbetter Clay
    Member
    Posted 9 years ago #

    There are a few plugins that aren't for what you want, but do what you need :)

    Admin Bar by MattRead

    Or

    Users online by Gamerz

  3. Ganked the code from the admin bar plugin:

    get_currentuserinfo();

    if ( isset($user_level) ) echo "logged in!";

    Thanks a lot. :)

  4. jcow
    Member
    Posted 8 years ago #

    http://wordpress.org/support/topic/36769?replies=9

    From Kafkaesqui:

    <?php
    global $user_login;
    get_currentuserinfo();
    if ($user_login) :
    ?>

    ~Do your login stuff~

    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.