Attachments from a post
$args = array(
‘post_parent’ => $post->ID,
‘post_type’ => ‘attachment’,
‘post_status’ => ‘any’,
‘fields’ => ‘ids’
);
$att = new WP_Query( $args );
// WP_Query arguments $args = array ( 'post_parent' => '$post->ID', 'post_type' => 'attachment', 'post_status' => 'any', ); // The Query $att = new WP_Query( $args );