Last active
March 17, 2017 13:27
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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