:) Hi good people :)

I have a beautiful layout of advanced form in html5. There's some JS scripts and CSS with flex box. What's the easiest way to add this form into WP theme? I try with CF7 but there's some issues, I should rearrange code and CSS specially for CF7 and I want to avoid that... any suggestions?

Thank you all!

  • You can do it with just php code. Setup a form.php file and put all your form cord there, in your form.php or in the function.php you can handle the form submission... eg. check if the form was submited, do validations and if it's all set, you can use wp_mail() to send the form. And you can insert this form in any page you want. – Cesar Henrique Damascena Aug 1 '17 at 23:29
  • Thank you :) Did you know any worthy tutorial for that? It's new for me :) – Damian P. Aug 1 '17 at 23:47

use wp_enqueue_script() function to load your required javascript and css files for the form. Then follow this tutorial to have knowledge about creating a form plugin and how to use that.

You have another option left. If you are familiar with WordPress page template then you can create a page template for the page that contains the form. Read more about page template from here.

  • Thank U! This tutorial help me a lot. But I have one question: is there any way to send mails without page reolading? :) – Damian P. Aug 3 '17 at 0:44
  • Yes there is. Please do study on wp.ajax – Sabbir Hasan Aug 4 '17 at 21:06

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.