Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter annettecm

    (@annettecm)

    Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi @annettecm,

    Thanks for using NextGEN Gallery Optimizer.

    I’ve been looking at your page’s source code, and the problem appears to be caused by an incompatibility between your theme’s custom JavaScript, and the latest version of WordPress v4.5 (which you’ve also updated to).

    WordPress v4.5 shipped with an updated version of the jQuery JavaScript library (v1.12.3), which is issuing the following error in Chrome’s developer tools console, and breaking your slideshow…

    “Uncaught Error: Syntax error, unrecognized expression: a[href^=#]”

    I’ve just tested your page’s source code with the earlier jQuery version of 1.11.3 (wp-includes/js/jquery/jquery.js?ver=1.11.3) which was available in WordPress 4.4, and I can confirm the error is *not* present, and your slideshow works as expected.

    Via a process of elimination of scripts in your source code, the error message and resulting slideshow breakage appears to be caused by the following file…

    http://costadelsolholidaylettings.co.uk/wp-content/themes/inspired/js/custom.js

    In order to resolve this properly, your theme developer would need to update their script for compatibility with jQuery v1.12.3, so you might like to open a support ticket with them, so they’re aware of the issue.

    And in the meantime, you can temporarily roll-back your jQuery version to v1.11.3 to fix the issue. To do this, I’ve written you a simple function which you can drop in your theme’s (or child theme’s) “functions.php” file…

    /**
     * Roll-back jQuery v1.12.3 which shipped with WP4.5, to v1.11.3 available in
     * WP4.4.
     *
     * We're deregistering it, and loading the older version from the jQuery CDN.
     *
     * NOTE: This is a temporary fix until the "Inspired" theme's "custom.js"
     * script is fully compatible.
     */
    function costadelsol_roll_back_jquery() {
    
    	if ( ! is_admin() ) {
    
    		wp_deregister_script( 'jquery' );
    		wp_register_script( 'jquery', 'https://code.jquery.com/jquery-1.11.3.min.js' );
    		wp_enqueue_script( 'jquery' );
    
    	}
    
    }
    add_action( 'init', 'costadelsol_roll_back_jquery' );

    I hope this helps!

    Cheers,
    Mark.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘slideshows not working’ is closed to new replies.