Home › Forums › Front-end Issues › get_posts and get custom value from their attachment › Reply To: get_posts and get custom value from their attachment
You can’t get the values for an image attached to a post because the meta values for an image are attached to the image. You must to a second get_post_meta supplying the attachment ID as the post id. The attachment ID is what is seen for the image value.
$image_meta = get_post_meta($attachment_id);
Hope that helps someone
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.