slug; //Get all images $onlyPostsImages = array(); foreach($allMyPosts as $key => $post){ $postID = $post->ID; $postTitle = $post->post_title; $post_attch = get_children('post_type=attachment&post_mime_type=image&post_parent='.$postID); if(!empty($post_attch)){ $thumbs = ''; foreach($post_attch as $attachment => $attachment_object){ $OriginalID = $attachment_object->ID; $imagearray = wp_get_attachment_image_src($OriginalID, "thumbnails"); $imageURI = $imagearray[0]; $imageObj = get_post($OriginalID); $imageID = $imageObj->ID; $imageTitle = $imageObj->post_title; $imageCaption = $imageObj->post_excerpt; $imageDescription = $imageObj->post_content; if(!empty($excludedImages)){ if(array_key_exists($catID, $excludedImages)) { if(array_key_exists($postID, $excludedImages[$catID])){ if(array_key_exists($imageID, $excludedImages[$catID][$postID])) $checkMe = ' checked="true"'; else $checkMe = ''; } else $checkMe = ''; } else $checkMe = ''; } else $checkMe = ''; //Output list of thumbs $thumbs .= '
'; $myResponse .= ''; $myResponse .= '
'; echo $myResponse; die(); ?>