- Timestamp:
- 01/29/2020 12:43:23 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyten/loop-attachment.php
r45932 r47122 106 106 } 107 107 108 // If there is more than 1 image attachment in a gallery 108 // If there is more than 1 image attachment in a gallery... 109 109 if ( count( $attachments ) > 1 ) { 110 110 $k++; 111 111 if ( isset( $attachments[ $k ] ) ) { 112 // get the URL of the next image attachment112 // ...get the URL of the next image attachment. 113 113 $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 114 } else { // or get the URL of the first image attachment 114 } else { 115 // ...or get the URL of the first image attachment. 115 116 $next_attachment_url = get_attachment_link( $attachments[0]->ID ); 116 117 } 117 118 } else { 118 // or, if there's only 1 image attachment, get the URL of the image119 // Or, if there's only 1 image attachment, get the URL of the image. 119 120 $next_attachment_url = wp_get_attachment_url(); 120 121 } 121 122 ?> 122 123 <p class="attachment"><a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"> 123 <?php 124 /** 125 * Filter the Twenty Ten default attachment width. 126 * 127 * @since Twenty Ten 1.0 128 * 129 * @param int The default attachment width in pixels. Default 900. 130 */ 131 $attachment_width = apply_filters( 'twentyten_attachment_size', 900 ); 132 /** 133 * Filter the Twenty Ten default attachment height. 134 * 135 * @since Twenty Ten 1.0 136 * 137 * @param int The default attachment height in pixels. Default 900. 138 */ 139 $attachment_height = apply_filters( 'twentyten_attachment_height', 900 ); 140 echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height. 141 ?> 124 <?php 125 /** 126 * Filter the Twenty Ten default attachment width. 127 * 128 * @since Twenty Ten 1.0 129 * 130 * @param int The default attachment width in pixels. Default 900. 131 */ 132 $attachment_width = apply_filters( 'twentyten_attachment_size', 900 ); 133 /** 134 * Filter the Twenty Ten default attachment height. 135 * 136 * @since Twenty Ten 1.0 137 * 138 * @param int The default attachment height in pixels. Default 900. 139 */ 140 $attachment_height = apply_filters( 'twentyten_attachment_height', 900 ); 141 // Filterable image width with, essentially, no limit for image height. 142 echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); 143 ?> 142 144 </a></p> 143 145 … … 178 180 179 181 <?php endwhile; 180 }; // end of the loop. ?>182 }; // End of the loop. ?>
Note: See TracChangeset
for help on using the changeset viewer.