• I have redirected example.com to example.com/wp-login.php.

    So, a user goes directly to wp-login.php and after logging in, is taken to an appropriate page using Peter’s login redirct plugin.

    However, if a logged in user tries going to example.com, he is still taken to example.com/wp-login.php asking for password.

    I want the redirection to be conditional. So, a user is taken to wp-login.php ONLY IF he is not already logged in.

    How can this be done?

Viewing 1 replies (of 1 total)
  • Hi

    Please try this function for user logged in or not

    “is_user_logged_in()”

    if (is_user_logged_in())
    {
    echo “user logged in”;
    }
    else
    {
    echo “user not logged in”;
    }

    Hope help this

Viewing 1 replies (of 1 total)

The topic ‘Conditional redirect’ is closed to new replies.