# Trekky

Please use the child theme then add code below in the functions.php file of the child theme.

```

if (!function_exists('trekky_form_login')) {
    function trekky_form_login() {
        if (trekky_is_woocommerce_activated() && 'yes' === get_option('woocommerce_enable_myaccount_registration')) {
            $register_link = get_permalink(get_option('woocommerce_myaccount_page_id'));
        } else {
            $register_link = wp_registration_url();
        }
        ?>
        <div class="login-form-head">
            <span class="login-form-title"><?php esc_attr_e('Sign in', 'trekky') ?></span>
            <span class="pull-right">
                <a class="register-link" href="<?php echo get_permalink(get_option('woocommerce_myaccount_page_id')); ?>"
                   title="<?php esc_attr_e('Register', 'trekky'); ?>"><?php esc_attr_e('Create an Account', 'trekky'); ?></a>
            </span>
        </div>
        <form class="trekky-login-form-ajax" data-toggle="validator">
            <p>
                <label><?php esc_attr_e('Username or email', 'trekky'); ?> <span class="required">*</span></label>
                <input name="username" type="text" required placeholder="<?php esc_attr_e('Username', 'trekky') ?>">
            </p>
            <p>
                <label><?php esc_attr_e('Password', 'trekky'); ?> <span class="required">*</span></label>
                <input name="password" type="password" required
                       placeholder="<?php esc_attr_e('Password', 'trekky') ?>">
            </p>
            <button type="submit" data-button-action
                    class="btn btn-primary btn-block w-100 mt-1"><?php esc_html_e('Login', 'trekky') ?></button>
            <input type="hidden" name="action" value="trekky_login">
            <?php wp_nonce_field('ajax-trekky-login-nonce', 'security-login'); ?>
        </form>
        <div class="login-form-bottom">
            <a href="<?php echo wp_lostpassword_url(get_permalink()); ?>" class="lostpass-link"
               title="<?php esc_attr_e('Lost your password?', 'trekky'); ?>"><?php esc_attr_e('Lost your password?', 'trekky'); ?></a>
        </div>
        <?php
    }
}
```

Choose Page My Account,  Go to WooCommerce > Settings > Advanced.

![](https://116778-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAngh8z22SV1W1zn3KR%2F-MAngpw7SgBpKjaOav9h%2F-MAnhsaQiPLQFkd59TlZ%2Fwoocommerce-page-setup.png?alt=media\&token=8e56ad18-a953-44c9-828f-9c7766a1aaed)

To add this form, you need to install the WooCommerce plugin and go to **WooCommerce->Settings** of your dashboard. Click on the **Privacy and Accounts** section and check the option to the **Allow customers to create an account on the “My Account” page** option.

![](https://116778-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAngh8z22SV1W1zn3KR%2F-MYwKSZkE-woCbdRIaR7%2F-MYwMYBUJbAaSRTrlxCh%2FScreenshot%20at%20Apr%2023%2008-34-27.png?alt=media\&token=0e74c1c6-e59e-4d27-b8f9-3f0fb0b77432)

Then check again the issue.
