You assign the ACF gallery to “article_with_gallery” and you grab the last part of the URL (“page1”), substring the “page” away and you get the current position for the gallery (=show first image on this page).
Then you just display the first image from the gallery (it’s a simple array). For the next page, the next gallery image.
The navigation (previous/next gallery image) simply takes you to the next/previous page in the URL.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users