WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] User logged in condition not working (2 posts)

  1. Nasir Zia
    Member
    Posted 2 years ago #

    Hi,
    I m using multisite and i have to apply a condition on my header which provide a logout option to the logged in users..

    I use this code in header..

    if ( is_user_logged_in() ) {
        echo 'logout';
    }
    else {
    echo 'Please Log in';
    }

    The condition works well on my main site (i.e, http://www.mysite.com).. but on other multisites (i.e, http://www.mysite.com/nasir) the condition is not true and it displays 'please log in', as if the user is not logged in..
    any solution :( ?

    [please don't bump]

  2. Don't bump your posts.

    If you're logged in for ONE site of your multisite, you're logged in for all of them (except if you're mapping domains, and that's a different drama).

    Flush all the cookies on your browser and log back in to try again. You may have something goobered.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.