title: How to show the login and register form on two different pages with WooCommerce using templates
body: <p>I have a my-account page which is displaying the <code>login</code> and <code>register</code> form. Below is the screenshot. There is no CSS as of now.</p>
  <p><a href="https://i.stack.imgur.com/A75Nt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A75Nt.png" alt="enter image description here" /></a></p>
  <p>My issue is, I have to separate both the pages. I mean I have to create a login and register both pages separately.</p>
  <p>This is the whole code <code>form-login.php</code></p>
  <pre><code>&lt;?PHP
  /**
   * Login Form
   *
   * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-login.php.
   *
   * HOWEVER, on occasion WooCommerce will need to update template files, and you
   * (the theme developer) will need to copy the new files to your theme to
   * maintain compatibility. We try to do this as little as possible, but it does
   * happen. When this occurs the version of the template file will be bumped and
   * the readme will list any important changes.
   *
   * @see     https://docs.woocommerce.com/document/template-structure/
   * @package WooCommerce\Templates
   * @version 4.1.0
   */
  
  if ( ! defined( 'ABSPATH' ) ) {
      exit; // Exit if accessed directly.
  }
  
  do_action( 'woocommerce_before_customer_login_form' ); ?&gt;
  
  &lt;?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?&gt;
  
  &lt;div class=&quot;u-columns col2-set&quot; id=&quot;customer_login&quot;&gt;
  
      &lt;div class=&quot;u-column1 col-1&quot;&gt;
  
  &lt;?php endif; ?&gt;
  
          &lt;h2&gt;&lt;?php esc_html_e( 'Login', 'woocommerce' ); ?&gt;&lt;/h2&gt;
  
          &lt;form class=&quot;woocommerce-form woocommerce-form-login login&quot; method=&quot;post&quot;&gt;
  
              &lt;?php do_action( 'woocommerce_login_form_start' ); ?&gt;
  
              &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide&quot;&gt;
                  &lt;label for=&quot;username&quot;&gt;&lt;?php esc_html_e( 'Username or email address', 'woocommerce' ); ?&gt;&amp;nbsp;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
                  &lt;input type=&quot;text&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text&quot; name=&quot;username&quot; id=&quot;username&quot; autocomplete=&quot;username&quot; value=&quot;&lt;?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?&gt;&quot; /&gt;&lt;?php // @codingStandardsIgnoreLine ?&gt;
              &lt;/p&gt;
              &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide&quot;&gt;
                  &lt;label for=&quot;password&quot;&gt;&lt;?php esc_html_e( 'Password', 'woocommerce' ); ?&gt;&amp;nbsp;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
                  &lt;input class=&quot;woocommerce-Input woocommerce-Input--text input-text&quot; type=&quot;password&quot; name=&quot;password&quot; id=&quot;password&quot; autocomplete=&quot;current-password&quot; /&gt;
              &lt;/p&gt;
  
              &lt;?php do_action( 'woocommerce_login_form' ); ?&gt;
  
              &lt;p class=&quot;form-row&quot;&gt;
                  &lt;label class=&quot;woocommerce-form__label woocommerce-form__label-for-checkbox woocommerce-form-login__rememberme&quot;&gt;
                      &lt;input class=&quot;woocommerce-form__input woocommerce-form__input-checkbox&quot; name=&quot;rememberme&quot; type=&quot;checkbox&quot; id=&quot;rememberme&quot; value=&quot;forever&quot; /&gt; &lt;span&gt;&lt;?php esc_html_e( 'Remember me', 'woocommerce' ); ?&gt;&lt;/span&gt;
                  &lt;/label&gt;
                  &lt;?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?&gt;
                  &lt;button type=&quot;submit&quot; class=&quot;woocommerce-button button woocommerce-form-login__submit&quot; name=&quot;login&quot; value=&quot;&lt;?php esc_attr_e( 'Log in', 'woocommerce' ); ?&gt;&quot;&gt;&lt;?php esc_html_e( 'Log in', 'woocommerce' ); ?&gt;&lt;/button&gt;
              &lt;/p&gt;
              &lt;p class=&quot;woocommerce-LostPassword lost_password&quot;&gt;
                  &lt;a href=&quot;&lt;?php echo esc_url( wp_lostpassword_url() ); ?&gt;&quot;&gt;&lt;?php esc_html_e( 'Lost your password?', 'woocommerce' ); ?&gt;&lt;/a&gt;
              &lt;/p&gt;
  
              &lt;?php do_action( 'woocommerce_login_form_end' ); ?&gt;
  
          &lt;/form&gt;
  
  &lt;?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?&gt;
  
      &lt;/div&gt;
  
      &lt;div class=&quot;u-column2 col-2&quot;&gt;
  
          &lt;h2&gt;&lt;?php esc_html_e( 'Register', 'woocommerce' ); ?&gt;&lt;/h2&gt;
  
          &lt;form method=&quot;post&quot; class=&quot;woocommerce-form woocommerce-form-register register&quot; &lt;?php do_action( 'woocommerce_register_form_tag' ); ?&gt; &gt;
  
              &lt;?php do_action( 'woocommerce_register_form_start' ); ?&gt;
  
              &lt;?php if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) : ?&gt;
  
                  &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide&quot;&gt;
                      &lt;label for=&quot;reg_username&quot;&gt;&lt;?php esc_html_e( 'Username', 'woocommerce' ); ?&gt;&amp;nbsp;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input type=&quot;text&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text&quot; name=&quot;username&quot; id=&quot;reg_username&quot; autocomplete=&quot;username&quot; value=&quot;&lt;?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?&gt;&quot; /&gt;&lt;?php // @codingStandardsIgnoreLine ?&gt;
                  &lt;/p&gt;
  
              &lt;?php endif; ?&gt;
  
              &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide&quot;&gt;
                  &lt;label for=&quot;reg_email&quot;&gt;&lt;?php esc_html_e( 'Email address', 'woocommerce' ); ?&gt;&amp;nbsp;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
                  &lt;input type=&quot;email&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text&quot; name=&quot;email&quot; id=&quot;reg_email&quot; autocomplete=&quot;email&quot; value=&quot;&lt;?php echo ( ! empty( $_POST['email'] ) ) ? esc_attr( wp_unslash( $_POST['email'] ) ) : ''; ?&gt;&quot; /&gt;&lt;?php // @codingStandardsIgnoreLine ?&gt;
              &lt;/p&gt;
  
              &lt;?php if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) : ?&gt;
  
                  &lt;p class=&quot;woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide&quot;&gt;
                      &lt;label for=&quot;reg_password&quot;&gt;&lt;?php esc_html_e( 'Password', 'woocommerce' ); ?&gt;&amp;nbsp;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input type=&quot;password&quot; class=&quot;woocommerce-Input woocommerce-Input--text input-text&quot; name=&quot;password&quot; id=&quot;reg_password&quot; autocomplete=&quot;new-password&quot; /&gt;
                  &lt;/p&gt;
  
              &lt;?php else : ?&gt;
  
                  &lt;p&gt;&lt;?php esc_html_e( 'A password will be sent to your email address.', 'woocommerce' ); ?&gt;&lt;/p&gt;
  
              &lt;?php endif; ?&gt;
  
              &lt;?php do_action( 'woocommerce_register_form' ); ?&gt;
  
              &lt;p class=&quot;woocommerce-form-row form-row&quot;&gt;
                  &lt;?php wp_nonce_field( 'woocommerce-register', 'woocommerce-register-nonce' ); ?&gt;
                  &lt;button type=&quot;submit&quot; class=&quot;woocommerce-Button woocommerce-button button woocommerce-form-register__submit&quot; name=&quot;register&quot; value=&quot;&lt;?php esc_attr_e( 'Register', 'woocommerce' ); ?&gt;&quot;&gt;&lt;?php esc_html_e( 'Register', 'woocommerce' ); ?&gt;&lt;/button&gt;
              &lt;/p&gt;
  
              &lt;?php do_action( 'woocommerce_register_form_end' ); ?&gt;
  
          &lt;/form&gt;
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;?php endif; ?&gt;
  
  &lt;?php do_action( 'woocommerce_after_customer_login_form' ); ?&gt;
  </code></pre>
  <p>I found two links on Stack Overflow:</p>
  <p><a href="https://stackoverflow.com/questions/41962909/how-to-create-separate-log-in-and-registration-pages-in-woocommerce">How to create separate log-in and registration pages in WooCommerce</a></p>
  <p><a href="https://stackoverflow.com/questions/23821488/separate-registration-page-in-woocommerce-website">Separate registration page in WooCommerce website</a></p>
  <p>I found this code</p>
  <pre><code>&lt;?php
  if( isset($_GET['action']) == 'register' ) {
      wc_get_template( 'myaccount/form-register.php' );
  } else {
      wc_get_template( 'myaccount/form-login-single.php' );
  }
  ?&gt;
  </code></pre>
  <p>I have several questions:</p>
  <ol>
  <li>Where should I add this code?</li>
  <li>Do I need to create a login and register page in WordPress?</li>
  <li>Or do I need to create a login and register inside my-account like <code>form-login-1.php</code> and <code>form-register-1</code> and add a code separately with a shortcode?</li>
  </ol>