Support » Plugin: Easy FancyBox » [Plugin: Easy FancyBox] Remove Additional Call for jQuery

  • Resolved Maximus Saint


    Hi, I’m having really hard times removing easy-fancybox’s call for jquery:
    as i understand, the developer of this plugin, for some reason decided to include a call for local jQuery library, which ruins my day since i’m calling jQuery from CDN directly in my template.

    I tried to find appropriate code in easy-fancybox.php but couldn’t.

    Please advise how can i remove this additional call.


Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author RavanH



    I advise you to NOT hardcode script calls in your theme. WordPress has a dedicated routine for that:

    This is the recommended way to include script files, even for those from CDN and the only way to avoid conflicts with plugins that need jQuery or other libraries.

    By far the easiest way to get jQuery from an external CDN is to remove that hardcoded line and install the plugin or any of the other ones that provide this function. These plugins will make ANY library (not only jQuery) that will be needed by any other plugin now and in the future be taken from Google’s CDN. So you’re safe for the future as well 😉

    I see, Thank you.

    To those who doesn’t want to waste time by reading manuals, place this into your functions.php:

    // Load jQuery from CDN
    function my_scripts_method() {
        wp_deregister_script( 'jquery' );
        wp_register_script( 'jquery', '');
        wp_enqueue_script( 'jquery' );
    add_action('wp_enqueue_scripts', 'my_scripts_method');

    and if you want to include your own script, use this code, just change the path and name for .JS:

    // Load my Script
    function myScript() {
       wp_enqueue_script('zion', '/js/zion.js', array('jquery'));
    add_action('init', 'myScript');

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Easy FancyBox] Remove Additional Call for jQuery’ is closed to new replies.