Support

Account

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

Solved

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 />';
      }
    
  • John I just did as You told me. The situation is the same. As an output i get the same id for every image I attached. And it`s id of first attached image. I edit my old post and add another image and still get only id of first attached image

Viewing 2 posts - 26 through 27 (of 27 total)

The topic ‘How to echo custom field from media attachment’ is closed to new replies.