0

Am using Jupiter theme. https://demos.artbees.net/jupiter/labrandeus/

The registration has by default username and password fields.

The view for it is defined as below:

<?php if (get_option('users_can_register')) {?>
            <div id="mk-register-panel">
                    <div class="mk-login-title"><?php _e("Create Account", 'mk_framework');?></div>

                    <form id="register_form" name="login_form" method="post" class="mk-form-regsiter" action="<?php echo site_url('wp-login.php?action=register', 'login_post')?>">
                        <span class="form-section">
                            <label for="log"><?php _e('Username', 'mk_framework');?></label>
                            <input type="text" id="reg-username" name="user_login" class="text-input">
                        </span>
                        <span class="form-section">
                            <label for="user_email"><?php _e('Your email', 'mk_framework');?></label>
                            <input type="text" id="reg-email" name="user_email" class="text-input">
                        </span>
                        <span class="form-section">
                            <input type="submit" id="signup" name="submit" class="accent-bg-color button" value="<?php _e("Create Account", 'mk_framework');?>">
                        </span>
<?php do_action('register_form');?>
                        <input type="hidden" name="user-cookie" value="1" />
                        <input type="hidden" name="redirect_to" value="<?php echo $current_url;?>?register=true" />
                        <div class="register-login-links">
                            <a class="mk-return-login" href="#"><?php _e("Already have an account?", 'mk_framework');?></a>
                        </div>
                    </form>
            </div>
<?php }?> 

I wanted to have the firstname, lastname and password to be included in the registration.

Am new to WordPress development. Trying to figure things out.

Can anyone please explain how this works.

Cheers!

0

You might want to look at a registration form plugin to do the job. There are quite a few around if you search for something like 'WordPress registration form plugin'. Here's one as an example... https://wordpress.org/plugins/userswp/. You should be able to install that in your site, then add your first name and last name fields in, then put a shortcode in your page.

  • Thank you, Martin. I am trying to add the additional fields to the existing registration form. This form is defined in /views/header/toolbar/login.php of the Jupiter's theme. What I am trying to do is add additional code into the existing functions.php file. – Noor M Aug 31 '18 at 10:02
  • I would still suggest using a plugin to do it, but if you want to go down the functions.php route, it might be worth asking the theme developers if they have a suggestion. In any event, make sure you make the functions.php changes to a child theme and not directly to your parent theme. Otherwise, you will lose those changes if ever the Jupiter theme gets updated. – Martin Jarvis Sep 1 '18 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.