Alex,
Since you're using conditionals to check for the presence of the form inside your plugin, and only then using the enqueue functions, the template tag has to happen BEFORE the instantiation of the wordpress query object for the enqueue to work. So if your template tag is in the loop or after 'the content', it ain't gonna happen.
Solution, create a template tag that returns the html of a form as an html escaped string, but doesn't echo it like the current one does.
Before the loop, add $my_form = get_gravity_form(1,false,false);
after the loop, echo $my_form; the scripts/css will be output.
I've confirmed that putting gravity_form(1,false,false) before the loop will output the script, after the loop, no (aforementioned reasons).
Posted 15 years ago on Tuesday November 17, 2009 |
Permalink