Redirect to Login Page in Member Access Only

Home Forums Legacy Support Support queries Child Themes Redirect to Login Page in Member Access Only

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19491
    ganutf
    Spectator
    How I redirect to login page (www.xyz.com/login) when a logged out user access a Member Access Only page? Thanks
    #19826
    H.K. Latiyan
    Participant
    Please use this code in your wplms-customizer.php file in wplms customizer plugin add_action('template_redirect','custom_non_loggedin_user_redirect'); function custom_non_loggedin_user_redirect(){ if(!is_user_logged_in()){ $login_page='http://xyz.com/login'; if ( is_page_template( 'page-members.php' ) ) { wp_redirect($login_page); exit; } } }  
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Redirect to Login Page in Member Access Only’ is closed to new replies.