query attachment images … if no attachments -> get attachments of parent page?
You can use get_children to check if it returns anything, then if it doesn’t, fetch the parent attachments. //loop stuff //your $query_images_args $attachments = get_children($query_images_args); if ( empty($attachments) ) { //go get parent attachments }else{ //loop through this post’s attachments }