//Die zum Post gehoerenden Bilder nach Sortierreihenfolge geordnet ins Array $images schreiben //Put all images attached to the post into $images array $images = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ); //Pruefen, ob dem Beitrag ueberhaupt Bilder angehaengt wurden. //check if there are any images attached to the post if (isset($images)) { //Den Zaehler auf 0 setzen //set counter to 0 $count=0; foreach( $images as $image ) { $imageID = $image->ID; //fuer jedes Bild im Array die URL von sowohl der Mittleren, als auch der grossen Groesse ermitteln. //get medium and large image url for all pictures attached to the post. $medImageSrc = wp_get_attachment_image_src($imageID, $size='medium', $icon = false); $largeImageSrc = wp_get_attachment_image_src($imageID, $size='large', $icon = false); //Wenn es sich um das erste Bild im Array handelt... //if it's the first image in the array if ($count==0) { //Den Greybox-Code mit einem Vorschaubild ausgeben //write greybox-code to display preview image (medium size) echo" "; } //alle Bilder ,die nach dem erstern Bild kommen //all further images else { //unsichtbare Greybox-Verknuepfung darstellen. //write hidden greybox-link (only displayed in window) echo""; } //Zaehler erhoehen. //count up. $count++; } //foreach } // $images