HomePage › Forums › Themes Support › Freshio – Organic & Food Store WordPress Theme › Removing Username from Header Login
- This topic has 6 replies, 2 voices, and was last updated 3 years, 7 months ago by Boyzico.
-
AuthorPosts
-
April 18, 2021 at 8:00 am #8283BoyzicoSupport Expired
Hello,
I want to remove the username from the login header dropdown, I want to leave as EMail only, Please assist.
Screenshot: https://prnt.sc/11lxa7g
April 19, 2021 at 2:16 pm #8340Hi,
About this issue, please paste this code into file functions.php ( child-theme):
function freshio_form_login() { if (freshio_is_woocommerce_activated()) { $account_link = get_permalink(get_option('woocommerce_myaccount_page_id')); } else { $account_link = wp_registration_url(); } ?> <div class="login-form-head"> <span class="login-form-title"><?php esc_attr_e('Sign in', 'freshio') ?></span> <span class="pull-right"> <a class="register-link" href="<?php echo esc_url($account_link); ?>" title="<?php esc_attr_e('Register', 'freshio'); ?>"><?php esc_attr_e('Create an Account', 'freshio'); ?></a> </span> </div> <form class="freshio-login-form-ajax" data-toggle="validator"> <p> <label><?php esc_attr_e('Email', 'freshio'); ?> <span class="required">*</span></label> <input name="username" type="text" required placeholder="<?php esc_attr_e('Email', 'freshio') ?>"> </p> <p> <label><?php esc_attr_e('Password', 'freshio'); ?> <span class="required">*</span></label> <input name="password" type="password" required placeholder="<?php esc_attr_e('Password', 'freshio') ?>"> </p> <button type="submit" data-button-action class="btn btn-primary btn-block w-100 mt-1"><?php esc_html_e('Login', 'freshio') ?></button> <input type="hidden" name="action" value="freshio_login"> <?php wp_nonce_field('ajax-freshio-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?', 'freshio'); ?>"><?php esc_attr_e('Lost your password?', 'freshio'); ?></a> </div> <?php }
April 19, 2021 at 3:57 pm #8354BoyzicoSupport ExpiredHello,
Thanks for your support so far, Just another question, If I want to change the user registration form from Username to Name, is this the code I need to change?
Screen shot – https://prnt.sc/11oxcvb
`<form method=”post” class=”woocommerce-form woocommerce-form-register register” <?php do_action( ‘woocommerce_register_form_tag’ ); ?> >
<?php do_action( ‘woocommerce_register_form_start’ ); ?>
<h2 class=”register-from-title”><?php esc_html_e( ‘Register’, ‘woocommerce’ ); ?></h2><?php if ( ‘no’ === get_option( ‘woocommerce_registration_generate_username’ ) ) : ?>
<p class=”woocommerce-form-row woocommerce-form-row–wide form-row form-row-wide”>
<label for=”reg_username”><?php esc_html_e( ‘Username’, ‘woocommerce’ ); ?>
<span class=”required”>*</span></label>
<input type=”text” class=”woocommerce-Input woocommerce-Input–text input-text” name=”username” id=”reg_username” autocomplete=”username” value=”<?php echo ( ! empty( $_POST[‘username’] ) ) ? esc_attr( wp_unslash( $_POST[‘username’] ) ) : ”; ?>”/><?php // @codingStandardsIgnoreLine ?>
</p>April 19, 2021 at 4:08 pm #8357Hi again,
About this issue, please override file form-login.php on woocommerce template.
Step 1: Copy file form-login.php ( link plugins/woocommerce/templates/templates/my-account/form-login.php and paste into: freshio theme (child-theme)/woocommerce/my-account/form-login.php
Step 2: Edit this form
April 19, 2021 at 4:12 pm #8358BoyzicoSupport ExpiredHello,
Thanks, I have done that already, what I’m asking is the code I sent earlier if I should replace all the username to Name?
Thanks
April 19, 2021 at 5:28 pm #8374Hi,
Yes, but you need to override the file form-login.php to edit this form.
April 19, 2021 at 5:55 pm #8376BoyzicoSupport ExpiredOk thanks
-
AuthorPosts
You must be logged in to reply to this topic.