Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*This goes in wp-config.php*/
- define('WPCF7_LOAD_JS', false); // Remove CF7 JavaScript
- define('WPCF7_LOAD_CSS', false); // Remove CF7 CSS
- /*This goes in function.php*/
- /* Contact Form 7 nur auf Kontakt Seite laden */
- add_filter( 'wpcf7_load_js', '__return_false' ); // Disable CF7 JavaScript
- add_filter( 'wpcf7_load_css', '__return_false' ); // Disable CF7 CSS
- add_action('wp_enqueue_scripts', 'load_wpcf7_scripts');
- function load_wpcf7_scripts() {
- if ( is_page('contact') ) {
- if ( function_exists( 'wpcf7_enqueue_scripts' ) ) {
- wpcf7_enqueue_scripts();
- }
- if ( function_exists( 'wpcf7_enqueue_styles' ) ) {
- wpcf7_enqueue_styles();
- }
- }
- }
- /*
- Tip
- You can also using page ID and even page name instead of page
- slug as the condition to match the page.
- Refer to is_page() documentation for possible usage.
- Note
- If you have multiple pages with CF7’s contact forms, you can use PHP or operator, ||,
- or use the array for is_page() function as the condition. For example:
- is_page( array( ‘contact’ , ‘feedback’ , ‘survey’ ) )*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement