// Same as above, but for multiple pages (from wpsnipp.com) // Load CF7 scripts & CSS only on page id's mentioned in array add_action( 'wp_print_scripts', 'deregister_cf7_javascript', 100 ); function deregister_cf7_javascript() { if ( !is_page(array(8,10)) ) { wp_deregister_script( 'contact-form-7' ); } } add_action( 'wp_print_styles', 'deregister_cf7_styles', 100 ); function deregister_cf7_styles() { if ( !is_page(array(8,10)) ) { wp_deregister_style( 'contact-form-7' ); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter