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.

Form displayed using shortcode : CSS not loaded

  1. I am displaying a payment form using the do_shortcode in a theme file.
    However, it doesn't load the Forms.css file.
    What is the best way to enqueue the CSS file properly & the clean way ?

    Posted 13 years ago on Wednesday November 23, 2011 | Permalink
  2. http://www.gravityhelp.com/documentation/page/Embedding_A_Form#Enqueue_Scripts_and_Styles

    You can use the function gravity_form_enqueue_scripts to enqueue the scripts and styles.

    Also, you don't have to use do_shortcode in your theme. You can use the Gravity Forms function directly. Details here: http://www.gravityhelp.com/documentation/page/Embedding_A_Form#Function_Call

    Posted 13 years ago on Wednesday November 23, 2011 | Permalink
  3. Thank you for the enqueue script tip. Though, it is not very convenient since I call the form in a content template. Any solution to embed the form in an iframe maybe ?

    Also, I can't use the Gravity Forms function for the moment since passing field values is not implemented yet. Any idea when it will be done ?

    Posted 13 years ago on Wednesday November 23, 2011 | Permalink
  4. Not sure how the iframe would help you here. Please explain.

    With the page template, you could add a conditional in your header.php to enqueue the scripts when that page template is used. Use the is_page_template function to enqueue the scripts only when you need to, when that template is being used.

    OK on using the do_shortcode function. It won't hurt anything like this and might be the easiest way for you.

    Posted 13 years ago on Thursday November 24, 2011 | Permalink