When setting up the galleries from carousels with Jetpack, I have found out that switching off the galleries feature in Jetpack is not enough, and the fancybox window jumps in into the display after you close the carousel.
To fix that issue, add the below small piece of code somewhere to your theme.
jQuery(document).ready(function() { setTimeout(function() { jQuery('.gallery a.fancybox').each(function() { jQuery(this).removeClass('fancybox').addClass('nofancybox'); if (jQuery(this).fancybox != undefined) { jQuery(this).unbind('click.fb'); jQuery(this).fancybox = function() {}; } }); }, 50); });
I know there are more beautiful ways of adding code to WordPress, please list them all in comments!
Hey there,
what you describe is exactly what I’m running in currently. But your fix doesn’t seem to work for me. Is there something I got to take care of or do I just copy the script in the head and it just works?
Many thanks,
Hannes
Sorry, just figured it our myself. I replaced the selector on line 4 with “a.fancybox.image'”. Now all is good =)