0

我在标签中显示了简单字段的第一个位置图像和第二个位置图像,当单击第二个图像时,必须在弹出窗口中打开相同的图像,特定的帖子包含多个图像。因此,当单击第二个图像时,必须查看相同的图像。但是当单击第二个图像时,第一个显示在弹出窗口中。请帮我找出我在以下代码中犯的错误...请指导我

<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>

4

0 回答 0