WordPress.org

Support

Support » How-To and Troubleshooting » two jquerys loading…one from disqus

two jquerys loading…one from disqus

  • I recently installed Disqus and noticed that it loads WordPress’ jQuery. I already have jQuery loading from Google so I’d like to take off Disqus’ version. Anyone know how? Also, anyone know how to disable Disqus styles and scripts for all pages except single pages?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Figured out how to do the first part.

    Just add this to your theme’s functions file.

    wp_deregister_script('jquery');

    Anyone have any idea how to disable Disqus styles and scripts for all pages except single pages?

    Something like this? (doesn’t work, though)

    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    
    function my_deregister_styles()
         if (!is_single) {
    	     wp_deregister_style( 'disqus' );
         }
    }
    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    
    function my_deregister_javascript()
         if (!is_single) {
    	    wp_deregister_script( 'disqus' );
         }
    }

    Nevermind, adding the following takes jQuery away from the dashboard as well.

    wp_deregister_script('jquery');

    Add this to your theme’s functions.php instead:

    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘two jquerys loading…one from disqus’ is closed to new replies.