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.

Gravity form enqueue scripts in functions.php vs. head.php

  1. Reading http://www.gravityhelp.com/documentation/page/Gravity_form_enqueue_scripts, it says to place the gravity_form_enqueue_scripts function immediately before wp_head();.

    Is there a reason that we can't safely hook on to wp_head() instead with a high priority?

    Both seem to work, but I like keeping my enequeue-ing in functions.php if possible.

    Posted 12 years ago on Thursday December 8, 2011 | Permalink
  2. Just for the sake of sharing my technique, here's the code I used. I only needed it for a form included on the homepage with gravity_form(), hence the if clause.

    http://pastebin.com/dC1Srath

    Posted 12 years ago on Thursday December 8, 2011 | Permalink
  3. Hi Mr Webb,

    Including it in the functions.php is ideal if you know what you're doing. The documentation is geared towards beginners where the simplest solution is often the best. :)

    Posted 12 years ago on Thursday December 8, 2011 | Permalink
  4. Ok. Good to know. It certainly makes more sense for it to be in functions.php.

    Wish they would mention that in the documentation. Would've saved me some panicked thoughts.

    Thanks!

    Posted 12 years ago on Thursday December 8, 2011 | Permalink

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