Created
December 16, 2020 11:35
-
-
Save stkjj/85dac069a41e2025372c63abea8e327e to your computer and use it in GitHub Desktop.
Load CF7 CSS and JS only on a per need base
This file contains hidden or 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
add_filter( 'wpcf7_load_js', '__return_false' ); | |
add_filter( 'wpcf7_load_css', '__return_false' ); | |
function reregister_cf7_js() { | |
if ( is_page (array(1,'kontakt'))) { | |
if (function_exists( 'wpcf7_enqueue_scripts')) { | |
wpcf7_enqueue_scripts(); | |
} | |
if (function_exists( 'wpcf7_enqueue_styles')) { | |
wpcf7_enqueue_styles(); | |
} | |
} | |
} | |
add_action('wp_enqueue_scripts','reregister_cf7_js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment