How to get pictures of the WordPress post
When you upload an attachment from the post edit screen, WordPress set the current post ID as the post_parent of the attachment. And that’s how you get these attachments: $post_ID = 123; $attachments = get_posts( array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘inherit’, ‘post_parent’ => $post_ID, ‘post_per_page’ => -1, ‘post_mime_type’ => ‘image/*’ ) ); foreach ( … Read more