我在标签中显示了简单字段的第一个位置图像和第二个位置图像,当点击第二个图像时,必须在弹出窗口中打开相同的图像,特定的帖子包含多个图像。因此,当单击第二个图像时,必须查看相同的图像。但第一个是在单击第二个图像时弹出窗口。请帮助我找到我在以下代码中完成的错误...请
引导我
<ul class="gallery clearfix">
<?php $j=0; for($i=0;$i<$count_project_image_count;$i++){ ?>
<li>
<a href="<?php echo get_option('siteurl');?>/wp-content/uploads/<?php echo get_post_meta(get_post_meta($posts['ID'], '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_'.$i, full), '_wp_attached_file', true); ?>" id="imageMagnifier<?php echo $posts['ID']; ?>" rel="prettyPhoto[gallery_image<?php echo $posts['ID']; ?>]"
class="class1" <?php if($j>0){ ?> style="display:none;" <?php } ?> >
<img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_option('siteurl');?>/wp-content/uploads/<?php echo get_post_meta(get_post_meta($posts['ID'], '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_0', thumbnail), '_wp_attached_file', true); ?>&w=200&h=200&zc=1"/>
</a>
<!-- if image count greater than 1 to display two images in product list -->
<?php if($count_project_image_count>1){ ?>
<a href="<?php echo get_option('siteurl');?>/wp-content/uploads/<?php echo get_post_meta(get_post_meta($posts['ID'], '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_'.$i, full), '_wp_attached_file', true); ?>" id="imageMagnifier<?php echo $posts['ID']; ?>" rel="prettyPhoto[gallery_image1<?php echo $posts['ID']; ?>]" class="class2" <?php if($j>0){ ?> style="display:none;" <?php } ?> >
<img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_option('siteurl');?>/wp-content/uploads/<?php echo get_post_meta(get_post_meta($posts['ID'], '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_1', thumbnail), '_wp_attached_file', true); ?>&w=200&h=200&zc=1"/>
</a>
<?php } ?>
<!--End of image count greater than 1 to display two images in product list -->
</li>
<?php $j++; } ?>
</ul>
<ul class="gallery clearfix">
<?php $j=0; for($i=0;$i<$count_project_image_count;$i++){ ?>
<li>
<a href="<?php echo get_option('siteurl');?>/wp-content/uploads/<?php echo get_post_meta(get_post_meta($posts['ID'], '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_'.$i, full), '_wp_attached_file', true); ?>" id="imageMagnifier<?php echo $posts['ID']; ?>" rel="prettyPhoto[gallery_image<?php echo $posts['ID']; ?>]"
class="class1" <?php if($j>0){ ?> style="display:none;" <?php } ?> >
<img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_option('siteurl');?>/wp-content/uploads/<?php echo get_post_meta(get_post_meta($posts['ID'], '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_0', thumbnail), '_wp_attached_file', true); ?>&w=200&h=200&zc=1"/>
</a>
<!-- if image count greater than 1 to display two images in product list -->
<?php if($count_project_image_count>1){ ?>
<a href="<?php echo get_option('siteurl');?>/wp-content/uploads/<?php echo get_post_meta(get_post_meta($posts['ID'], '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_'.$i, full), '_wp_attached_file', true); ?>" id="imageMagnifier<?php echo $posts['ID']; ?>" rel="prettyPhoto[gallery_image1<?php echo $posts['ID']; ?>]" class="class2" <?php if($j>0){ ?> style="display:none;" <?php } ?> >
<img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_option('siteurl');?>/wp-content/uploads/<?php echo get_post_meta(get_post_meta($posts['ID'], '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_1', thumbnail), '_wp_attached_file', true); ?>&w=200&h=200&zc=1"/>
</a>
<?php } ?>
<!--End of image count greater than 1 to display two images in product list -->
</li>
<?php $j++; } ?>
</ul>