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 add gravity forms to a custom page template/html file?

  1. luxerman
    Member

    I created a custom page template that uses static HTML, so it's not calling the header, basic css or js files that a regular wordpress theme would have.

    Picture a static HTML page... How would I add form #1 to it?

    thank you

    Posted 11 years ago on Wednesday January 23, 2013 | Permalink
  2. luxerman
    Member

    I added the following codes to the header:

    <link rel="stylesheet" href="/wp-content/plugins/gravityforms/css/forms.css">
    <script type='text/javascript' src='/wp-content/plugins/gravityforms/js/gravityforms.js?ver=1.6.11'></script>
    <script type='text/javascript' src='/wp-content/plugins/gravityforms/js/conditional_logic.js?ver=1.6.11'></script>

    but nothing appears... I've tried both the following within the php file:

    (<?php gravity_form(1, false, false, false, '', false); ?>) and ([gravityform id=1 title=false description=false])

    The funny thing is... I can't see the form but it appears within the pages source file. So why is it loading, but not showing?

    Posted 11 years ago on Wednesday January 23, 2013 | Permalink
  3. luxerman
    Member

    I'm getting a:

    element.style {
        display: none;
    }

    when viewing it under firebug for some reason?

    Posted 11 years ago on Wednesday January 23, 2013 | Permalink
  4. We will need a link to the page on your site where we can see this.

    When a form is hidden with the "display:none;" it's usually because it has conditional logic, and it's all hidden by default until Gravity Forms' jQuery runs to remove that hidden attribute. When there are JavaScript errors on the page, or you do not include the Gravity Forms scripts, the form will not be displayed.

    In your second comment, that is not the correct way to add Gravity Forms scripts. Please use the gravity_form_enqueue_scripts function:
    http://www.gravityhelp.com/documentation/page/Gravity_form_enqueue_scripts

    It's also documented on the page where the function call method of embedded a form is explained:

    http://www.gravityhelp.com/documentation/page/Embedding_A_Form#Function_Call

    Posted 11 years ago on Wednesday January 23, 2013 | Permalink
  5. I didn't read all the way to the first topic you posted. Gravity Forms relies on WordPress functions, so you might need to strip down a template file and include your form in it.

    Posted 11 years ago on Wednesday January 23, 2013 | Permalink