Home › Forums › General Issues › Use of get_field in multisite › Reply To: Use of get_field in multisite
Hi @websul
The get_field function will work for you. Perhaps you forgot to use the $post_id parameter?
If the image field is ‘portalImage’, then change:
$gallery = get_post_meta($post->ID, 'portalImage', true); //this field is type gallery
to
$gallery = get_field('portalImage', $post->ID); //this field is type gallery
Your next issues is that your comment mentions this is a gallery field, not an image field. Is this correct?
If so, you need to update your code to loop through the gallery images. Please refer to the docs for this.
Thanks
E
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.