Home › Forums › Front-end Issues › advanced custom fields checkbox and gallery › Reply To: advanced custom fields checkbox and gallery
I’m assuming from your question that the “gallery” is not created on the page in question and is created somewhere else since checking the field will let you add it to any page. If this is the case then you need to supply ACF with the post ID of where the gallery is stored, whether that be another post or on an options page.
$images = get_field('gallery', $post_id);
For more information see the documentation for get field https://www.advancedcustomfields.com/resources/get_field/, especially the part about getting a value from different places.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.