]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-content/themes/twentytwelve/image.php
WordPress 4.0
[autoinstalls/wordpress.git] / wp-content / themes / twentytwelve / image.php
index 285e453c71017e097931b8abac93f17576546d1b..1dc2aa931294a18a5fc2711087a08ae83f17c22f 100644 (file)
@@ -58,9 +58,9 @@ foreach ( $attachments as $k => $attachment ) :
                break;
 endforeach;
 
-$k++;
 // If there is more than 1 attachment in a gallery
 if ( count( $attachments ) > 1 ) :
+       $k++;
        if ( isset( $attachments[ $k ] ) ) :
                // get the URL of the next image attachment
                $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );