是的,基本上,我希望能够显示15个图像附加到某个页面,并在页面有15个以上的图像时进行分页。
我对这种问题不是很熟悉,所以我有点困惑。
<?php $args = array(\'numberposts\' => 15, \'orderby\' => \'menu_order\', \'order\' => \'ASC\', \'post_type\' => \'attachment\', \'post_mime_type\' => \'image\', \'post_parent\' => $post->ID); ?>
<?php if ( $photos = get_posts($args) ) : ?>
<?php foreach ( $photos as $photo ) : ?>
<a href="<?php echo $photo->guid; ?>" target="_blank" class="lightbox" rel="[<?php echo $post->ID; ?>]"><?php echo wp_get_attachment_image($photo->ID,\'thumbnail\'); ?></a>
<?php endforeach; ?>
<?php endif; ?>