単純なフィールドの 1 番目の位置の画像と 2 番目の位置の画像をタグに表示しました。2 番目の画像をクリックすると、ポップアップで同じ画像を開く必要があります。特定の投稿には複数の画像が含まれています。したがって、2 番目の画像をクリックすると、同じ画像が表示される必要があります。しかし、2番目の画像をクリックすると、最初の画像がポップアップで表示されます。次のコードで行った間違いを見つけるのを手伝ってください...ガイドしてください
<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>