Support

Account

Home Forums General Issues How to echo custom field from media attachment Reply To: How to echo custom field from media attachment

  • I don’t see any reason that it would be doing that. Try echoing out the id as well and see if you are getting values for different attachments.

    
    foreach ($attachments as $attachment) {
        echo $attachment->ID,': ',get_field('custom-field-name', $attachment->ID),'<br />';
      }