0

The question sounds weird i know, but what i'm trying to do is add a gravity form into a template that i made.

But all of their tutorials seem to be more along the lines of adding a form to a page and not so much to a template.

So the idea was to use a get_content() from a specific Page that i created (called "Form" in this case) put that into it's own content-form.php file and then call a get_template_part() into the section of my template where i need it in.

First off, is this too much abstraction? If it's just better to somehow call the form from this specific Form Page into my template of choice i'll do that but i'm just not sure how to go about this.

Thanks.

closed as off-topic by birgire, mrwweb, gmazzap, Pieter Goosen, Johannes Pille Sep 3 '14 at 9:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – birgire, mrwweb, gmazzap, Pieter Goosen, Johannes Pille
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Gravity Forms provides a shortcode -- [form], IIRC. You could consider adding something like do_shortcode( '[form id="1"]' ); to your template. (Assuming that the form you want had the ID 1, of course.) – Pat J Oct 20 '13 at 23:06
  • @ChipBennett I haven't tried anything yet other than creating the page because i didn't really know what to do. – MARS Oct 21 '13 at 1:18
  • @PatJ Please post your above comment as an answer - because it most probably is the answer. – tfrommen Oct 28 '13 at 7:44
  • Done -- though I think SeekingCharlie has the better answer, which uses a GravityForms function rather than do_shortcode(). – Pat J Oct 28 '13 at 13:11
1

You can just put something like the following into your template file where you want the form to appear (example of a form called Contact Us):

gravity_form('Contact Us', false, false, false, '', false);

For more info on the false etc, see here: http://www.gravityhelp.com/documentation/page/Embedding_A_Form

  • @kaiser, thank you for sharing that link, and snippet both solved my problem. – MARS Oct 27 '13 at 22:38
  • 2
    @MARS It wasn't me, but "SeekingCharlie". I just edited the answer. And please mark the answer as solved (check mark below voting arrows) if that solved your problem. – kaiser Oct 27 '13 at 23:03
  • @SeekingCharlie thanks for the answer worked perfectly. – MARS Oct 29 '13 at 3:28
0

Gravity Forms provides a shortcode -- [form], IIRC. You could consider adding something like do_shortcode( '[form id="1"]' ); to your template. (Assuming that the form you want had the ID 1, of course.)

Not the answer you're looking for? Browse other questions tagged or ask your own question.