I used fancybox 2 on my wordpress site and it worked for the longest time but recently it hasn’t been working on this page (and other pages using fancybox) http://haniabyanyacole.com/?page_id=110
This is the error i’m getting: Uncaught TypeError: Object [object Object] has no method ‘fancybox’
I looked around on the other stackoverflow pages and saw others had similar problems, mostly dealing with multiple jquery libs loaded, but I’ve only loaded it once, and at the top of the page. Can anyone help?
SOLVED: I ended up loading a previous version of jquery (when the plugin still worked) and it fixed fancybox
I took a quick peek at your page. Based on the errors, it appears like Fancybox was simply broken by the latest version of jQuery being loaded from here…
http://code.jquery.com/jquery-latest.js
This is the downside to using a CDN containing
jquery-latest.js… you’ll just never know when the latest jQuery version will break some incompatible out-of-date jQuery plugin.You’ll have to figure out how to edit your WordPress template to only load the last version of jQuery compatible with your Fancybox… probably version 1.8.3.
http://code.jquery.com/jquery-1.8.3.min.js
Otherwise, investigate if there is an updated version of Fancybox available for use with the latest jQuery, version 1.9.1. (As per this jsFiddle, it already looks like Fancybox 2.1.4 works with jQuery 1.9.1)
Here are the links to all past versions of jQuery for your reference:
http://code.jquery.com/#jquery-all
Also read about the “wp enqueue script” at the following link, since you do not want to load multiple versions of jQuery on the same page…
http://codex.wordpress.org/Function_Reference/wp_enqueue_script