The difference is that on the page with the form in the body, the default Gravity Forms styles are loaded and applied. On pages where it's just the form in the header, the styles aren't loaded because they're not being enqueued because you're using the function call to embed the form outside of the WordPress loop.
When embedding a form via a function call you must also manually include the necessary Gravity Forms related Javascript and CSS via the built in WordPress enqueue capabilities. Gravity Forms does not include these by default when calling a form via a function call and they are necessary for forms that contain conditional logic or the date picker field.
We strongly recommend you enqueue the scripts rather than including them as hard-coded calls in your theme. Implementing it this way will insure that Gravity Forms does not include them on the page if they are already present. It is also a good practice to only load these scripts on the front end.
Gravity Forms 1.5 introduced the gravity_form_enqueue_scripts function which allows you to easily enqueue the necessary Gravity Forms' scripts and styles when manually embedding a form. This is also useful if you are using a GF widget and do not wish for the styles and scripts to be loaded inline.
You will need to manually enqueue the scripts and CSS by placing a short script block in your theme's header.php file.
You can find more information at the URLs below
http://www.gravityhelp.com/documentation/page/Embedding_A_Form
http://www.gravityhelp.com/documentation/page/Gravity_form_enqueue_scripts
Posted 14 years ago on Friday May 20, 2011 |
Permalink