Login Not Working

This topic contains 4 replies, has 4 voices, and was last updated by  Paolo 5 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #3997

    jwallace1127
    Free User
    Post count: 1

    How do I block my website to anyone who isn’t logged in with your plugin? The way I am currently doing it isn’t working correctly with Users WP:
    // Redirect users who arent logged in…
    function members_only() {
    global $pagenow;
    // Check to see if user in not logged in and not on the login page
    if( !is_user_logged_in() && $pagenow != ‘/login’ )
    auth_redirect();
    }
    add_action( ‘wp’, ‘members_only’ );

    It keeps redirecting and looping. Please help.

    #3998

    Alex Rollin
    Moderator
    Post count: 27815

    UsersWP uses the WordPress built in WordPress functions and doesn’t adjust roles or otherwise identify/change users, so, they are not UsersWP users, just WP users.

    If you need help redirecting logged out users you can find a freelancer to help you with that here:

    https://geodirectoryexperts.com/

    #4002

    Patrik
    Moderator
    Post count: 1971

    If you want to redirect users from wp-admin login page to UsersWP login page then there is a setting in UsersWP->General->Login.

    Regards,
    Patrik

    #4003

    jwallace1127
    Free User
    Post count: 1

    I’m sorry, maybe I wasn’t clear. I don’t think either response really answers my question.

    How do I keep the website blocked for everyone but wpusers? So if they visit the website, they have to log in immediately.

    #4009

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    Alex response is correct, this is not a support question about UsersWP and we don’t debug custom code.

    You could try this plugin instead: https://wordpress.org/plugins/wp-force-login/

    and eventually redirect wp-login.php to /login/ page if it doesn’t give an option to tell which login page to use.

    Thank you

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket