Skip to content

Instantly share code, notes, and snippets.

@2803media
Last active September 7, 2015 16:20
Show Gist options
  • Select an option

  • Save 2803media/593c3b71c8085b92041a to your computer and use it in GitHub Desktop.

Select an option

Save 2803media/593c3b71c8085b92041a to your computer and use it in GitHub Desktop.
Enlever et ne garder que l'essentiel
/*A mettre dans votre fichier functions.php de votre thème*/
/*remove contact form js and css*/
add_filter( 'wpcf7_load_js', '__return_false' );
add_filter( 'wpcf7_load_css', '__return_false' );
// include WPCF7 js+css on Contact page only
add_action('wp_enqueue_scripts', 'add_wpcf7_scripts');
function add_wpcf7_scripts() {
if (is_page(array('1126'))) {
if (function_exists('wpcf7_enqueue_scripts')) {
wpcf7_enqueue_scripts();
wpcf7_enqueue_styles();
}
}
}
/*remove js and css easy fancybox*/
add_action('wp_head','my_conditional_script',0);
function my_conditional_script() {
if (is_front_page() || is_home() || is_page()) {
remove_action('wp_enqueue_scripts', array('easyFancyBox','enqueue_styles'), 999);
remove_action('wp_print_scripts', array('easyFancyBox','register_scripts'), 999);
remove_action('wp_head', array('easyFancyBox','main_script'), 999);
remove_action('wp_footer', array('easyFancyBox','enqueue_footer_scripts'), 999);
remove_action('wp_footer', array('easyFancyBox', 'on_ready'), 999);
}
}
/*remove smiley js*/
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment