Adding more fields to the registration form

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!

Topic user-registration custom-field Wordpress

Category Web


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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.