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.

Custom CSS file loading on every page, not just pages with forms.

  1. I created a plugin to enqueue a custom css file and it works great. Problem is, it loads on every page on the website and I need to make it smarter. How can I fire off wp_enqueue_style() only on pages where a GravityForms form is being loaded?

    Posted 12 years ago on Friday September 21, 2012 | Permalink
  2. David Peralty

    Can you post your code to pastebin or something similar so I can see it? There are many ways to conditionally load scripts.

    Posted 12 years ago on Friday September 21, 2012 | Permalink
  3. Sure. Here is the code: http://pastebin.com/PrJFEdYc

    Thank you for taking a look at it David.

    Posted 12 years ago on Friday September 21, 2012 | Permalink
  4. You can use the gform_enqueue_scripts filter:
    http://www.gravityhelp.com/documentation/page/Gform_enqueue_scripts

    Posted 12 years ago on Saturday September 22, 2012 | Permalink
  5. Perfect. Thank you! That worked great.

    Posted 12 years ago on Saturday November 24, 2012 | Permalink

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