Changeset 47122 for trunk/src/wp-content/themes/twentyeleven/image.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyeleven/image.php
r45932 r47122 76 76 } 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 } else { // or get the URL of the first image attachment 84 } else { 85 // ...or get the URL of the first image attachment. 85 86 $next_attachment_url = get_attachment_link( $attachments[0]->ID ); 86 87 } 87 88 } else { 88 // or, if there's only 1 image, get the URL of the image89 // Or, if there's only 1 image, get the URL of the image. 89 90 $next_attachment_url = wp_get_attachment_url(); 90 91 } 91 92 ?> 92 93 <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"> 93 <?php 94 /** 95 * Filter the Twenty Eleven default attachment size. 96 * 97 * @since Twenty Eleven 1.0 98 * 99 * @param int The height and width attachment size dimensions in pixels. Default 848. 100 */ 101 $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 ); 102 echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height. 103 ?> 94 <?php 95 /** 96 * Filter the Twenty Eleven default attachment size. 97 * 98 * @since Twenty Eleven 1.0 99 * 100 * @param int The height and width attachment size dimensions in pixels. Default 848. 101 */ 102 $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 ); 103 // Filterable image width with 1024px limit for image height. 104 echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); 105 ?> 104 106 </a> 105 107 … … 131 133 <?php comments_template(); ?> 132 134 133 <?php endwhile; // end of the loop. ?>135 <?php endwhile; // End of the loop. ?> 134 136 135 137 </div><!-- #content -->
Note: See TracChangeset
for help on using the changeset viewer.