This members-only tutorial provides the steps to set up Oxygen Easy Posts on a CPT archive with featured image opening a lightbox that shows images set in Advanced Custom Fields Gallery-type field as a slider for each post.
ACF Gallery field for Portfolio CPT:
Gallery field being populated for a CPT entry
CPT archive page:
Portfolio CPT archive page
When an entry's featured image is clicked:
For posts that do not have at least one image set in the gallery, we will show the featured image.
We shall use GLightbox for the lightbox and Flickity for the slider.
Step 1
Let us register a custom image size for the featured images and images in the lightboxes.
Register your Custom Post Type (with archive enabled) either manually or using a plugin like Custom Post Type UI. In my test site, I used the Portfolio Post Type plugin.
Upload glightbox.min.js and flickity.pkgd.min.js to the plugin's assets/js directory. Create a file named say, glightbox-flickity-init.js in the same location having: