Solution for different Gallery-View with WP-Standards

I just wrote about the plugin „Photospace“ which is a nice quick and dirty solution for what I wanted.

But the function of this plugin wasn’t enough for my manners, so I decided to view the code and put it down for my own.

Here’s the solution: (you’ve got to put this in image.php!)

    $gallery_div = "<div id='$selector' class='gallery  gallery-columns-{$columns} gallery-size-{$size_class}'>";
    echo $gallery_div;

                    $images = get_children( array( 'post_parent' => $post->post_parent, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
                    foreach ($images as $key => $value) {
                        echo '<dl style="float:left;margin-right:10px;">';
                        echo '<dt><a href="?attachment_id='.$key.'#mdbt_attachment"><img src="'.$value->guid.'" style="height:150px; width:150px;" /></a></dt>';
                        echo '</dl>';
                    if ( count ($images) > 1 ) {
                        if ( isset ($images [$key] )) {
                            //url vom nächsten bild holen
                            $next_image = get_attachment_link( $images[$key]->ID);
                        else {
                            // hol dir sonst die url vom ersten bild
                            $next_image = get_attachment_link( $images[0]->ID);
                    else {
                        $next_attachment_url = wp_get_attachment_url();

                        //echo '<a href="'.the_permalink().'">'.$image_img_tag.'</a>';

                    /*if ( $images ) :
                        $total_images = count( $images );
                        $image = array_shift( $images );
                        $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );*/


Would appreciate if someone’s „feedbacking“ me 🙂

I just will write an update because this isn’t the finished version at all! Stay tuned to get the final version soon!