PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to embed form into my single.php page

  1. jerome281
    Member

    I try to setup an apply online job form on my single.php page. How can I embed my form?

    Posted 14 years ago on Sunday January 17, 2010 | Permalink
  2. You can find this information in the documentation section on the following page. http://www.gravityhelp.com/documentation/embedding-a-form/

    Posted 14 years ago on Sunday January 17, 2010 | Permalink
  3. If you go to the Help page within Gravity Forms it shows how to use the shortcode to insert a form into a page or post without editing a theme file.

    It also shows how to use the function call to display a form by adding this code to your theme file. This is more advanced usage, we usually recommend using shortcodes unless there is a specific reason as to why it needs to be hardcoded into your theme.

    The documentation can also be found within the Documentation area on this site:

    http://www.gravityhelp.com/documentation/embedding-a-form/

    Posted 14 years ago on Sunday January 17, 2010 | Permalink
  4. jerome281
    Member

    Thanks Kevin for the quick reply, sorry still confuse what do I have to put in my fuctions.php file and single.php (to call the form)?

    Posted 14 years ago on Sunday January 17, 2010 | Permalink
  5. You don't have to put anything in your functions.php file.

    The article kevin pointed out in the documentation explains the function call you would use in your single.php theme file. It would look like this:

    <?php gravity_form(X, true, true); ?>

    The "X" would be replaced with the id of the form you want to call. The first true is if you want to display the form title and the second true is if you want to display the form description. These values can both be false.

    It's explains on this page under "Function Call":

    http://www.gravityhelp.com/documentation/embedding-a-form/

    Is there any reason why you want to hardcode the form in your theme template files instead of using the shortcode and inserting the form in a post or page when you create the post or page?

    Posted 14 years ago on Sunday January 17, 2010 | Permalink
  6. jerome281
    Member

    Worked like a charm! Thank you so much, I just need it this php line of code.

    Posted 14 years ago on Sunday January 17, 2010 | Permalink