Duplicate Images When Attempting Gallery
-
When I attempt to integrate the plugin into my theme for my gallery, I’m met with duplicate images. Essentially there are 5 images loaded on the page and responsive lightbox shows about 18, there are around 3 duplicates for each image.
Can anyone help me find out whats casing the issue?
here is my code
<?php query_posts('post_type=illustrations'); ?> <?php get_header(); ?> <div class="container"> <div class="row main-work-spacer"> <?php $postCount = wp_count_posts("illustrations"); $archImgCount = 0; //basic loop while (have_posts() ) : the_post(); ?> <div class=" col-md-4"> <a href="<?php $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); echo $feat_image; ?>" rel="lightbox" data-lightbox-gallery="lightbox[gallery-1]"> <?php //is there a featured image? if( has_post_thumbnail() ) { the_post_thumbnail( 'gallery-medium' ); } ?> </div> <?php $archImgCount++; //this line is to prevent an extra row from being added on our last item if($postCount->publish % 3 != 0 || $archImgCount < $postCount->publish){ //if are on our third image start a new row if($archImgCount % 3 == 0){ ?> </div> <div class="row main-work-spacer"> <?php } } endwhile; ?> </div> </div> <?php get_footer(); ?>
Thanks in advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Duplicate Images When Attempting Gallery’ is closed to new replies.