I've set Fancybox to only make galleries of images within posts, instead it creates a gallery that includes unrelated images located in my sidebar as well. The code it uses does not distinguish between images contained with the post class and images outside of it. Is there a custom query workaround that can prevent this? Otherwise it's something that would need to be fixed for the next release.
I've discovered the reason why it does this: on single post pages rather than using the correct query to only open images within the post class, it instead uses this query:
jQuery(thumbnails).addClass("fancybox").attr("rel","fancybox").getTitle();
The correct query for single posts should be:
var posts = jQuery('.post');
posts.each(function() {
jQuery(this).find(thumbnails).addClass("fancybox").attr('rel','fancybox'+posts.index(this)).getTitle()
});
Yay, works great now, thanks! :)
ohburnie
Member
Posted 9 months ago #
This solves the problem of galleries on the same page but in different posts merging together in one fancybox.
Thank you!!!!