Would you like to add your WPForms shortcode directly to your PHP template? There are many different ways to include your WPForms inside your pages an editor from WordPress, through a page builder plugin or even through widget areas but did you know you can directly add the shortcode directly to any PHP template? In this tutorial, we’ll show you the PHP to use to include the shortcode inside a PHP template.
It’s very important to note that we never recommend making any changes to any of your theme files without the use of a child theme. For more information on how to add code to any template file in your theme, please review this documentation.
Just be sure to update the
"X" with the form ID number you want to include in the template.
And that’s all you need! Would you also like to know how to display a shortcode inside an HTML Field inside your form? Take a look at our article on How to Display Shortcodes Inside the HTML Field.