WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Template Logged In or Logged Out PHP? (5 posts)

  1. JAB Creations
    Member
    Posted 6 years ago #

    What code do I need for the template's PHP to argue if the current status of the visitor is logged in or out? I will be using this to display a sign in form if they are not currently logged in and a sign out anchor if they are. Thanks!

  2. JAB Creations
    Member
    Posted 6 years ago #

    I think this may relate to is_user_logged_in, doing some reading now, help is still appreciated! ;-)

  3. JAB Creations
    Member
    Posted 6 years ago #

    <?php
    if ( is_user_logged_in() ) {echo 'WordPress says you\'re logged in!';}
    else if ( !is_user_logged_in() ) {echo 'WordPress says you\'re <b>not</b> logged in!';}
    ?>

  4. JAB Creations
    Member
    Posted 6 years ago #

    This is a function and a handy list of functions can be found at...
    http://codex.wordpress.org/Plugin_API#Functions_You_Can_Override

  5. LightBred
    Member
    Posted 5 years ago #

    Thank you for sharing this, I was looking for the exact thing.

Topic Closed

This topic has been closed to new replies.

About this Topic