<?php
/**
- * The template for displaying image attachments.
+ * The template for displaying image attachments
*
- * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ * @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
<div class="entry-attachment">
<div class="attachment">
<?php
-/**
+/*
* Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery,
* or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file
*/
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 );
endif;
?>
<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
+ /**
+ * Filter the image attachment size to use.
+ *
+ * @since Twenty Twelve 1.0
+ *
+ * @param array $size {
+ * @type int The attachment height in pixels.
+ * @type int The attachment width in pixels.
+ * }
+ */
$attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
echo wp_get_attachment_image( $post->ID, $attachment_size );
?></a>