Changeset 47122 for trunk/src/wp-content/themes/twentytwelve/image.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwelve/image.php
r45932 r47122 74 74 break; 75 75 } 76 endforeach;76 endforeach; 77 77 78 // If there is more than 1 attachment in a gallery 78 // If there is more than 1 attachment in a gallery... 79 79 if ( count( $attachments ) > 1 ) : 80 80 $k++; 81 81 if ( isset( $attachments[ $k ] ) ) : 82 // get the URL of the next image attachment82 // ...get the URL of the next image attachment. 83 83 $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 84 84 else : 85 // or get the URL of the first image attachment85 // ...or get the URL of the first image attachment. 86 86 $next_attachment_url = get_attachment_link( $attachments[0]->ID ); 87 87 endif; 88 else :89 // or, if there's only 1 image, get the URL of the image90 $next_attachment_url = wp_get_attachment_url();91 endif;92 ?>88 else : 89 // Or, if there's only 1 image, get the URL of the image. 90 $next_attachment_url = wp_get_attachment_url(); 91 endif; 92 ?> 93 93 <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"> 94 <?php95 /**96 * Filter the image attachment size to use.97 *98 * @since Twenty Twelve 1.099 *100 * @param array $size {101 * @type int The attachment height in pixels.102 * @type int The attachment width in pixels.103 * }104 */105 $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );106 echo wp_get_attachment_image( $post->ID, $attachment_size );107 ?>94 <?php 95 /** 96 * Filter the image attachment size to use. 97 * 98 * @since Twenty Twelve 1.0 99 * 100 * @param array $size { 101 * @type int The attachment height in pixels. 102 * @type int The attachment width in pixels. 103 * } 104 */ 105 $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) ); 106 echo wp_get_attachment_image( $post->ID, $attachment_size ); 107 ?> 108 108 </a> 109 109 … … 135 135 <?php comments_template(); ?> 136 136 137 <?php endwhile; // end of the loop. ?>137 <?php endwhile; // End of the loop. ?> 138 138 139 139 </div><!-- #content -->
Note: See TracChangeset
for help on using the changeset viewer.