Of course it’s easy to add Gravity Forms to your page or post with the little button they give you or with shortcode, but what if you want to add a form to a template page with PHP? Then, it’s slightly more tricky, but still easy. Here’s what you need to do:
1) Get the basic code you need here:
Basically, you need to know if you want to show the form title and description or not, and then either the name of the form, or the form ID#. If in doubt, I would go with this:
gravity_form(1, false, false, false, '', true, 12);
2) In your template file, find where you want the form to go and figure out if you are in the PHP section of the code or the HTML section of the code. If you are in the PHP section, just add the above in as is. If you are in the HTML section (seeing lots of div’s and no php’s) then you will need to add the php code around it like this:
Hope I explained this well enough. Let me know if you need more details.
Leave a Reply