HomePage › Forums › Themes Support › Freshio – Organic & Food Store WordPress Theme › How to edit login/register default form ?
- This topic has 9 replies, 2 voices, and was last updated 2 years, 1 month ago by Billy Nguyen.
-
AuthorPosts
-
March 21, 2022 at 2:30 pm #21392gowebsSupport Expired
Hi,
i want to edit form field default for reg/login. Please how can i do that ?
Thank you
March 22, 2022 at 8:43 am #21410gowebsSupport Expiredi want edit this dropdown login / register.
this default : https://nimb.ws/1heFAO
how can i do that.
March 22, 2022 at 10:13 am #21435Hi you,
To edit this form login, please copy this function and paste to file functions.php ( child-theme), then edit:
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('Username or email', 'freshio'); ?> <span class="required">*</span></label> <input name="username" type="text" required placeholder="<?php esc_attr_e('Username', '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> //Add shortcode Captcha <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 }
March 22, 2022 at 12:53 pm #21450gowebsSupport ExpiredHi,
how can edit code
…..
} else {
$account_link = wp_registration_url();….
change to direct link go to register page, like “my account” in footer bar (mobile version).
- This reply was modified 2 years, 1 month ago by gowebs.
March 22, 2022 at 2:10 pm #21455You can edit code:
$account_link = 'your-link';
March 22, 2022 at 2:43 pm #21457gowebsSupport Expiredit’s not work, how can edit button to direct link or popup (not login/reg) without dropdown like footer bar button for “my account”.
March 22, 2022 at 3:08 pm #21458gowebsSupport ExpiredThis reply has been marked as private.March 23, 2022 at 1:42 pm #21483Hi,
You need to overwrite main.js file to remove this js dropdown:Copy this code to file functions.php:
add_action( 'after_setup_theme', 'freshio_fnc_custom_script' ); function freshio_fnc_custom_script() { add_action('wp_enqueue_scripts','freshio_register_scripts_custom'); } function freshio_register_scripts_custom(){ wp_dequeue_script( 'freshio-theme' ); wp_deregister_script( 'freshio-theme' ); wp_enqueue_script( 'custom-freshio-theme', get_stylesheet_directory_uri() . '/main.js' ); }
Then copy the file themes/freshio/assets/js/frontend/main.js and paste to child-tehme
Edit file main.js: https://ibb.co/ZdpPyLK
March 24, 2022 at 8:28 am #21446gowebsSupport ExpiredThis reply has been marked as private.March 24, 2022 at 2:11 pm #21549Please copy this code to 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="woocommerce-form woocommerce-form-login login" method="post"> <?php do_action( 'woocommerce_login_form_start' ); ?> <div class="woocommerce-form-login-wrap"> <h2 class="login-form-title"><?php esc_html_e( 'Login', 'woocommerce' ); ?></h2> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> <label for="username"><?php esc_html_e( 'Username or email address', 'woocommerce' ); ?> <span class="required">*</span></label> <input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="username" autocomplete="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?>"/><?php // @codingStandardsIgnoreLine ?> </p> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> <label for="password"><?php esc_html_e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label> <input class="woocommerce-Input woocommerce-Input--text input-text" type="password" name="password" id="password" autocomplete="current-password"/> </p> <?php do_action( 'woocommerce_login_form' ); ?> <button type="submit" class="woocommerce-button button woocommerce-form-login__submit" name="login" value="<?php esc_attr_e( 'Log in', 'woocommerce' ); ?>"><?php esc_html_e( 'Log in', 'woocommerce' ); ?></button> </div> <label class="woocommerce-form__label woocommerce-form__label-for-checkbox woocommerce-form-login__rememberme"> <input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever"/> <span><?php esc_html_e( 'Remember me', 'woocommerce' ); ?></span> </label> <?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?> <p class="woocommerce-LostPassword lost_password"> <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'woocommerce' ); ?></a> </p> <?php do_action( 'woocommerce_login_form_end' ); ?> </form> <?php }
-
AuthorPosts
You must be logged in to reply to this topic.