From the course: Custom WordPress Plugins: Design, Develop, and Distribute
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
Creating fields for our contact form - WordPress Tutorial
From the course: Custom WordPress Plugins: Design, Develop, and Distribute
Creating fields for our contact form
- [Instructor] In the last video, we set up our plugin's file structure and main PHP file. Now let's create our field to our contact form. Again, you should code along with me as I go, but if you need the full code, reference your chapter two files on GitHub. We want our contact form to obtain the following information, a first name, last name, email, phone number, and message. First, let's save our contacts for everyone .php file. Next, navigate to your contact form .php file. Here we're going to build out our form, using some good old HTML. Remember, PHP files can hold plain HTML as well. Let's start with the form tag. Let's get the form and ID, cfe-contact-form. Method is going to be post and we're going to leave the action blank. The ID CFE contact form will be used for the form styling. We're also going to wrap each field in a div group and give these divs the same class, cfe form-group. That's, again, for styling. Let's do our first div and make our first name field. We're going…