• Resolved everydayphotoclass

    (@everydayphotoclass)


    When I enable comments for logged in users only, a login link is displayed for people who are not logged in. However this link takes them to the standard wordpress login. How can I change this to a different login destination. Specifically I want them to login through the woocommerce interface as my customers would normally do.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    A plugin (woocommerce) that has its own login page should capture requests to
    https://mysite.com/wp-login.php
    so i really think this question should be asked to the developers of woocommerce.

    You should be able to extend your .htaccess file in the wp root with a redirection to the woocommerce login page, but – unfortunately – i am not an expert on that topic.

    Thread Starter everydayphotoclass

    (@everydayphotoclass)

    thank you for the direction on this.

    Thread Starter everydayphotoclass

    (@everydayphotoclass)

    I did some research and found a bit of code that I added to my child function.php and it works like a charm to customize/redirect the login destination. Here it is just in case you find this to be helpful. This could be a nice feature to add to this plugin in the future.

    function possibly_redirect(){
      global $pagenow;
      if( 'wp-login.php' == $pagenow ) {
        if ( isset( $_POST['wp-submit'] ) ||   // in case of LOGIN
          ( isset($_GET['action']) && $_GET['action']=='logout') ||   // in case of LOGOUT
          ( isset($_GET['checkemail']) && $_GET['checkemail']=='confirm') ||   // in case of LOST PASSWORD
          ( isset($_GET['checkemail']) && $_GET['checkemail']=='registered') ) return;    // in case of REGISTER
        else wp_redirect('YOUR CUSTOM LOGIN URL'); // or wp_redirect(home_url('/login'));
        exit();
      }
    }
    add_action('init','possibly_redirect');
    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Thanx for the info.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to change the login link for comments’ is closed to new replies.