I have a client that needs a custom registration form.
- I need to make a custom design on this page
- I need to add custom fields like First Name, Company, Phone, etc.
Someone can help me with this?
I have a client that needs a custom registration form.
Someone can help me with this?
You must be logged in to post a comment.
A better place to ask WordPress questions is probably on WordPress Answers. Anyhoo, if you want to solve this without plugins, you need three things:
When you have these three parts in place, you can do the following in your Page Template:
Now, when you want to retrieve the stuff you’ve stored, you need to know whether the information is within the User object itself or in metadata. To retrieve the first and last name (of a logged-in user):
To retrieve the company name (of a logged-in user):
That’s the basic gist of it. There’s still a lot of stuff missing here, like validation, error message output, the handling of errors occurring within the WordPress API, etc. There’s also some important TODO’s that you have to take care of before the code will even work. The code should probably also be split into several files, but I hope this is enough to get you started.
An advantage of using a custom registration form is that modifying the code according to the user’s needs becomes easy. For a custom submit form you can make use of existing hooks in WordPress like
template_redirect
and then map that hook to some function which will do the post-processing of the form, like validation and submitting data to the site’s database. You can refer to an in-depth article here.PHP function
A custom WordPress registration form has two major advantages over the standard form.
The first is the integration with the overall look and feel of the website theme. Standard forms often donât work well with custom themes and there is always a chance that the custom CSS files do not render well with the form. A custom form, on the other hand, can be easily set up to work with custom CSS.
The second and more popular reason of using a custom registration form is the option of custom fields that are not included on the standard form. A small custom registration form speeds up the process and collects all the necessary data from a neat interface.
This form can be inserted anywhere by using the shortcode [wp_registration_form]. Here is the code snippet for setting up the shortcode:
I hope that by now you have a fair idea of creating a WordPress custom Registration form.Still any confusion kindly check Build Custom WordPress Registration Forms