Skip to content

Instantly share code, notes, and snippets.

@karki-dennis
Last active March 17, 2017 13:27
Show Gist options
  • Save karki-dennis/13e92a202f4d2b338d6abda185fee01b to your computer and use it in GitHub Desktop.
Save karki-dennis/13e92a202f4d2b338d6abda185fee01b to your computer and use it in GitHub Desktop.
Remove Gravity Form Css and Scripts from specific pageFrom http://aaronjerad.com/blog/remove-gravity-forms-css-and-scripts-from-specific-pages/
//Deregister Gravity Stylesheets and Scripts from specific pages
add_action("gform_enqueue_scripts", "deregister_scripts");
function deregister_scripts(){
//Change this conditional to target whatever page or form you need.
if(is_front_page()) {
//These are the CSS stylesheets
wp_deregister_style("gforms_formsmain_css");
wp_deregister_style("gforms_reset_css");
wp_deregister_style("gforms_ready_class_css");
wp_deregister_style("gforms_browsers_css");
//These are the scripts.
//NOTE: Gravity forms automatically includes only the scripts it needs, so be careful here.
//wp_deregister_script("gforms_conditional_logic_lib");
//wp_deregister_script("gforms_ui_datepicker");
//wp_deregister_script("gforms_gravityforms");
//wp_deregister_script("gforms_character_counter");
//wp_deregister_script("gforms_json");
//wp_deregister_script("jquery");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment