Conditioning JS and CSS load
-
I am apply the filters and code explained here: https://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/ to load the files just on pages which contain contact forms.
This is the code that i am using:
add_filter( 'wpcf7_load_js', '__return_false' ); add_filter( 'wpcf7_load_css', '__return_false' ); if ( function_exists( 'wpcf7_enqueue_scripts' ) ) { if ( is_page('descargas') || is_page('contactar') ) { wpcf7_enqueue_scripts(); } } if ( function_exists( 'wpcf7_enqueue_styles' ) ) { if ( is_page('descargas') || is_page('contactar') ) { wpcf7_enqueue_styles(); } }For this page: https://goo.gl/7Jdbzc
But like you see, this page doesn’t load CF7 CSS or JS, BUT form works fine, it is ok??
Thank you.
The topic ‘Conditioning JS and CSS load’ is closed to new replies.