NextGen Gallery Fancybox Conflict

I have the latest version of Wordpress running Sage 8.2.1 with NextGen Gallery 2.1.60 and NextGen Gallery Plus 1.3.31 installed. I’m using the Pro Masonry feature with Fancybox and it’s throwing several errors.

After switching to the default WP theme and the errors disappearing this issue is linked to the Sage theme. I also disabled all plugins & cleared cache.

The errors are:

jquery.fancybox-1.3.4.pack.js?ver=2.1.60:18
Uncaught TypeError: Cannot read property ‘msie’ of undefined(…)

captions.js?ver=4.5.3:3
Uncaught TypeError: Cannot read property ‘msie’ of undefined(…)

jquery.js:9793
Uncaught TypeError: t.indexOf is not a function(…)ht.fn.load

Any ideas how to fix this?

None of those errors are directly related to Roots. Best thing to do is Google/Youtube search on how to debug JavaScript console errors; you could even search for those specific errors in each respective script.

Hi @cfx, thanks for your reply.

If I use the default WP 2016 theme + NextGen plugins, the errors are gone but if I use the Sage theme, they exist. So doesn’t that point to the Sage theme as the issue?

It might, depending on changes you’ve made to either theme or how the plugins are developed. Can you verify how many instances and which versions of jQuery are loaded?

Sure thing, it’s loading in the head and just one instance:

<script type='text/javascript' src='http://localhost/asaderococina/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
<script type='text/javascript' src='http://localhost/asaderococina/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>

I also disabled Soil Relative Urls since it was conflicting with the NextGen plugin.

Thanks so much for your help with this!

Seems those plugins are using an outdated jQuery method.

Yep, I found that link before posting here. :slight_smile: The site is using the jquery migrate plugin and it’s still broke.

Even if it’s using the outdated jquery method, how is it that the feature works with the default WP theme?

Probably because Soil enqueues a modern version of jquery, and Sage has that theme option set by default…