Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @olivvv59

    You can redirect users to the UM Login page when they visit the default WP login page with the following code snippet:

    add_action('init','um_102521_redirect_to_um_login');
    function um_102521_redirect_to_um_login(){
          global $pagenow;
          if( ! function_exists("um_get_core_page" ) ) return;
    
          if( 'wp-login.php' == $pagenow ) {
                wp_redirect( um_get_core_page("login") );
                exit();
          }
    }

    You can add the code to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code.

    Regards,

    • This reply was modified 4 years, 7 months ago by Champ Camba.
    Thread Starter olivvv59

    (@olivvv59)

    thanks a lot.

    i had to adapt it because my logout didn’t work anymore.

    add_action('init','um_102521_redirect_to_um_login');
    function um_102521_redirect_to_um_login(){
          global $pagenow;
          if( ! function_exists("um_get_core_page" ) ) return;
    
          if( 'wp-login.php' == $pagenow ) {
            if ((isset($_GET['action']) == "logout")) {
            }
            else
            {
                wp_redirect( um_get_core_page("login") );
                exit();
            }
             
          }
    }

    like it works very good.

    • This reply was modified 4 years, 7 months ago by olivvv59.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Thanks for letting us know. I’m marking this as resolved now.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘change default login page ?’ is closed to new replies.