dylanpaul
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: Contact Form 7] jquery issue ?It appears that the jQuery slider and the Contact Form 7 plugin’s css and/or scripts conflict in Safari and IE, causing the slider to break. This does not appear to be an issue in Firefox.
By default, Contact Form 7 loads its css and scripts to every page, including the page with your jQuery slider. The easiest way to resolve this is to disable Contact Form 7 from loading its css and scripts to the page that includes your jQuery slider. Or, rather, load the Contact Form 7 css and scripts only to the contact form page(s).
I found this solution on the website Technically Easy, within the post “How To Load the Contact Form 7 Script for a Contact Page Only.” Here’s how it works:
1. Add this code to your functions.php file (which is found in Appearance > Editor > functions.php):
add_action( ‘wp_print_scripts’, ‘my_deregister_javascript’, 100 );
function my_deregister_javascript() {
if ( !is_page(‘Contact’) ) {
wp_deregister_script( ‘contact-form-7’ );
}
}add_action( ‘wp_print_styles’, ‘my_deregister_styles’, 100 );
function my_deregister_styles() {
if ( !is_page(‘Contact’) ) {
wp_deregister_style( ‘contact-form-7’ );
}
}2. In the above code, change the two instances of ‘Contact’ within “( !is_page(‘Contact’)” to the name of your contact page. If you have more than one contact page, simply add additional pages separated by a comma, as in (‘Contact1′,’Contact2’) etc.
Hope this helps!