Problem page: www.kendraschaefer.com/mandapop (problem with images in thin middle column)
Hi,
I'm working on a new Wordpress template, and I've run into an issue with Fancybox. I'm trying to get the pictures in the thin middle column of the page above to, when clicked on, pop up in fancybox with attached post data.
It's mostly working OK - on first click, no problem. Click an image, post pops up in a fancybox. But close the fancybox and try again, and you'll notice that the post loads once, then loads again. Click on aother, and this time the post loads multiple times. (Don't click too many times, your browser will freak). Sounds like a recursion problem, but I'm not sure where I'm going wrong.
I tried using other pop-up plugins, like Facebox and Lightbox, with the same problem, so it must be my loop or something. I also commented out all other javascript on the page to see if there was a conflict - still had the problem.
Here's my code (there are two loops - one for the gallery images and one for the blog entries):
<div id="homeGalleryCol">
<div id="homeGalleryContent">
<?php
query_posts('post_type=galleryimage&posts_per_page=7');
if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="singlePhotoPost">
<h3 class="galleryListDate"><?php the_time('M d'); ?></h3>
<a href="<?php the_permalink(); ?>" class="fancybox"><?php the_post_thumbnail('gallery-pic-thumbnail'); ?></a>
</div><!-- end singlePhotoPost -->
<?php endwhile; ?>
<?php endif; ?>
</div><!-- end homeGalleryContent -->
</div><!-- end homeGalleryCol -->
<div id="thinRightCol">
<div id="rightColContent">
<div id="blogListColWrapper">
<div id="blogListCol">
<?php
query_posts('posts_per_page=3');
global $more;
$more = 0;
if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="singlePost">
<h3 class="blogListDate"><?php the_time('M d'); ?></h3>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
<h2 class="postTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_content('<span class="moretext"> </span>'); ?>
</div><!-- end singlePost -->
<?php endwhile; ?>
<?php endif; ?>
</div><!-- end blogListCol -->
</div><!-- end blogListColWrapper -->
</div><!-- end rightColContent -->
</div><!-- end thinRightCol -->
Thanks much.