Your account expired support, please renew to get your support.

HomePage Forums Themes Support Freshio – Organic & Food Store WordPress Theme Removing Username from Header Login

Topic Resolution: Resolved
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #8283
    Boyzico
    Support 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

    #8340

    Hi,

    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
    	}
    #8354
    Boyzico
    Support Expired

    Hello,

    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>

    #8357

    Hi 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

    #8358
    Boyzico
    Support Expired

    Hello,

    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

    #8374

    Hi,

    Yes, but you need to override the file form-login.php to edit this form.

    #8376
    Boyzico
    Support Expired

    Ok thanks

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.