Home Forums General Issues Thumbnail Gallery with Lightbox Reply To: Thumbnail Gallery with Lightbox

  • Hi @thinkjon

    Here’s a simple example how to get the thumbnail images from the CPT posts:

    $posts = get_posts(array(
    	'posts_per_page'	=> -1,
    	'post_type'			=> 'custom_post_type_slug'
    if( $posts ): ?>
    	<?php foreach( $posts as $post ): 
    		setup_postdata( $post )
                <?php $image = get_field('thumbnail_field_name'); ?>
    			<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
    	<?php endforeach; ?>
    	<?php wp_reset_postdata(); ?>
    <?php endif; ?>

    Where ‘custom_post_type_slug’ is the slug of your CPT and ‘thumbnail_field_name’ is the name of your image custom field. These pages should give you more idea about it: and

    If you want to learn PHP, I recommend you checking this site: If you don’t have the time to do it, I suggest you hire a developer to help you out with it, and I’d recommend looking for one on or

    Hope this helps 🙂