]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-content/themes/twentyten/loop.php
Wordpress 3.0.1
[autoinstalls/wordpress.git] / wp-content / themes / twentyten / loop.php
index 84c167dc466a02f28b7531b1a7fa3a6a498c8b78..c0d746f332aaf1d2c2862c828c793cb045316792 100644 (file)
                        <div class="entry-content">
 <?php if ( post_password_required() ) : ?>
                                <?php the_content(); ?>
-<?php else : ?>
-                               <div class="gallery-thumb">
-<?php
-       $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
-       $total_images = count( $images );
-       $image = array_shift( $images );
-       $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
-?>
-                                       <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
-                               </div><!-- .gallery-thumb -->
-                               <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'twentyten' ),
-                                               'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
-                                               $total_images
-                                       ); ?></em></p>
-
-                               <?php the_excerpt(); ?>
+<?php else : ?>                        
+                               <?php 
+                                       $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
+                                       if ( $images ) :
+                                               $total_images = count( $images );
+                                               $image = array_shift( $images );
+                                               $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
+                               ?>
+                                               <div class="gallery-thumb">
+                                                       <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
+                                               </div><!-- .gallery-thumb -->
+                                               <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'twentyten' ),
+                                                               'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
+                                                               $total_images
+                                                       ); ?></em></p>
+                               <?php endif; ?>
+                                               <?php the_excerpt(); ?>
 <?php endif; ?>
                        </div><!-- .entry-content -->