that is a very annoying issue and in most cases I fix it for my clients. I am using fancybox 2, but there are a lot of themes who are including fancybox 1 with another handle name for the script in the wp_enqueue_script function.
How do you handle this common issue? I just saw a plugin with fancybox 2, that renamed fancybox to fancybox2 in the code. Do you think this ia a proper solution?
These types of issues are always annoying. Authors should really work towards minimizing them. I personally have the option in the Theme Options of my themes where you can turn off the lightbox that comes with the theme and it doesn’t load the script at all if switched off.
I would recommend creating a child-theme for that theme (if it is child-theme compatible) and editing the function that loads the scripts to load yours instead. This way you don’t have to hard-edit the theme and lose the changes on every update. Good luck!
In your fancybox 2 script run something like this:
wp_deregister_script('fancybox 1'); wp_register_script('fancybox 2'); wp_enqueue_script('fancybox 2');
Untested and just a though …
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.