WordPress has no default form or way to create custom registration and login pages. However, it is quite possible to do all this yourself! I’ll try to get you started:
1. Page Templates
WordPress offers something called Page Templates. You can add a file (e.g. tpl-my-template.php
to your theme and add
/*
Template Name: My Template
*/
at the start of the file. Now, when you create a page in the admin panel, the “Page Attributes” box on the right allows you to select this template. When a page with “My Template” as the template is displayed, it will use the file tpl-my-template.php
.
You could create page templates for the login page and for the registration page, so you can add your forms and custom logic to the page via the page templates.
2. Adding the form
Next, you can add the registration form (or login form) with any fields you like. For security, you should add a hidden nonce field to this form.
3. Handling the form
WordPress is event-driven. It allows you to “hook into” actions and filters. You should do the same when checking your form. Try hooking into the init
action, which is basically fired after most basic setup is completed but no output has been generated yet.
add_action( 'init', 'wpse152106_handle_registration' );
function wpse152106_handle_registration() {
// Handle registration form
}
3.a Registration
To add a new user to an installation, you can use wp_insert_user
, combined with add_user_meta
for your custom fields.
3.b Logging in
You can log in using wp_signon
, which also does error checking for you, returning a WP_Error
object on failure.
I hope I’ve given you a few waypoints in tackling this problem!