Last active
          April 23, 2019 11:45 
        
      - 
      
- 
        Save max-kk/a07157e3674efd8dd2c2b6ebb88efcac to your computer and use it in GitHub Desktop. 
    LRM :: redirect_all_no_logged_in_users
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // Copy After | |
| // Add this to your child theme functions.php | |
| add_action( 'template_redirect', 'redirect_to_specific_page' ); | |
| function redirect_to_specific_page() { | |
| if ( ! is_page('login') && ! is_user_logged_in() ) { | |
| wp_redirect( 'http://www.example.dev/login/', 302 ); | |
| exit; | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment