Get images attached to a specific page
$is = get_children(“post_parent=$id&post_type=attachment&post_mime_type=image”); foreach($is as $i) { $url = wp_get_attachment_image_src($i->ID, ‘full’); $caption = $i->post_title); } $id is the id of your post. See http://codex.wordpress.org/Function_Reference/get_children