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.

Inserting Form via PHP in a non-standard page

  1. I'm trying to edit a welcome gate type plugin, that shows a welcome page once on a new user's first visit, and throw a form on it.

    I've stripped away everything except the form, and it's still not working, so I'm guessing it's missing some header codes or javascript or something that get's included that I don't see when I drop it in via the shortcode menu.

    How can I insert a form on a non-standard page? The form shows, but doesn't respond.

    Here's the page

    http://itarsenal.com/welcome

    Here's the page code that I stripped, there's a bunch more elements in the plugin, but I erased everything to try and troubleshoot except the form insert code.

    Help appreciated, I'm not sure what's missing.

    ====

    <!DOCTYPE html>
    <html>
    <head>

    </head>
    <body>

    <center><?php echo do_shortcode('[gravityform id="2" name="Mailchimp ITA Newsletter Form" title="false" description="false" ajax="false"]'); ?></center>

    </body>
    </html>

    Posted 12 years ago on Wednesday August 8, 2012 | Permalink
  2. Throw wp_head() and/or wp_footer() into your template page.

    Posted 12 years ago on Wednesday August 8, 2012 | Permalink
  3. Can I get the raw code?

    The standard head and footer isn't used in the plugin since it is a custom welcome page, it strips and replaces these elements...

    -r

    Posted 12 years ago on Wednesday August 8, 2012 | Permalink
  4. David Peralty

    Try adding this to your head area -
    http://www.gravityhelp.com/documentation/page/Gravity_form_enqueue_scripts

    Posted 12 years ago on Wednesday August 8, 2012 | Permalink
  5. Hmm when I have this as the code for the index.php page, it seems to strip the head part...no change for the form.

    It's live here http://itarsenal.com/welcome

    <!DOCTYPE html>
    <html>
    <head>
    <?php
    gravity_form_enqueue_scripts(2, false);
    ?>
    </head>
    <body>

    <center><?php echo do_shortcode('[gravityform id="2" name="Mailchimp ITA Newsletter Form" title="false" description="false" ajax="false"]'); ?></center>
    test

    </body>
    </html>

    Posted 12 years ago on Wednesday August 8, 2012 | Permalink
  6. David Peralty

    Yeah, there is no way of making this work without hooking it into WordPress' functions. Currently all you have is a non-wordpress page that you are trying to get a Gravity Form to work on. You will need get WordPress involved in this template. I can't remember the minimum to do that though. I'll have to search for using WordPress functions in a non-WordPress page.

    Posted 12 years ago on Wednesday August 8, 2012 | Permalink
  7. Hmm I see, so throwing this into this plugin which has it's own structure, that looks outside of WP normal functions, as it pretty much strips the page of everything but a title some big bold words and a form spot...this just looks like it won't happen.

    Bummer...thank you.

    Posted 12 years ago on Wednesday August 8, 2012 | Permalink

This topic has been resolved and has been closed to new replies.