/ Published in: PHP

Prevents WordPress from loading Contact Form 7 on page templates other than the one defined.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
add_action ('wp_print_scripts', 'my_deregister_cform', 100); function my_deregister_cform() { if (!is_page_template('page-contact.php')) { wp_deregister_script('contact-form-7'); } }
Comments
