foreach pagination image output

hello how can i add a pagination to a foreach? i want to display 30 images and then it should continue from 31 at the page 2.

Thank for your help =)

my code:

<?php $images = get_post_meta($post->ID, 'vdw_gallery_id', true);
	foreach ($images as $image) { ?>	
		<div class="cf-item gallery-item fw-col-xs-12 fw-col-sm-4 fw-col-md-3">
					<a href="<?php echo wp_get_attachment_url($image); ?>" data-size="1678x900" title="Project name">
						<div class="a-img">
							<?php echo wp_get_attachment_image($image , array(1687,900)); ?>
		<?php }

Read more here: foreach pagination image output

Leave a Reply

Your email address will not be published. Required fields are marked *