Forums

Detect if user is a guest (4 posts)

  1. Ryan Paul
    Member
    Posted 4 years ago #

    Is there any tag or function I can use to detect if the person viewing my blog is a guest or logged in?

    Why isn't there something like: if( is_guest() ) function?

  2. MichaelH
    Volunteer
    Posted 4 years ago #

    There is this:

    <?php
    global $user_login;
    if( $user_login ) {
    echo 'user logged in';
    } else {
    echo 'user not logged in';
    }
    ?>
  3. htan
    Member
    Posted 4 years ago #

    This shoutbox have that functionality too

  4. MichaelH
    Volunteer
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic