Support

Account

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