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?
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?
Can you post your code to pastebin or something similar so I can see it? There are many ways to conditionally load scripts.
Sure. Here is the code: http://pastebin.com/PrJFEdYc
Thank you for taking a look at it David.
You can use the gform_enqueue_scripts filter:
http://www.gravityhelp.com/documentation/page/Gform_enqueue_scripts
Perfect. Thank you! That worked great.