Home › Forums › ACF PRO › Get gallery from post object › Reply To: Get gallery from post object
Hi @redsun
Did you call the post object field outside The Loop? If you did, you need to set the post ID for the second parameter like this:
global $post;
$post_objects = get_field('gallery_select', $post->ID);
Also, please make sure that you used a multiple post objects field. If you used a single post object field, you don’t have to loop through the $post_objects
variable.
If you still can’t solve the issue, could you please share the JSON or XML export file of your field group?
Thanks!
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.