Changeset 42343 for trunk/src/wp-content/themes/twentytwelve/image.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwelve/image.php
r32116 r42343 15 15 <div id="content" role="main"> 16 16 17 <?php while ( have_posts() ) : the_post(); ?> 17 <?php 18 while ( have_posts() ) : 19 the_post(); 20 ?> 18 21 19 22 <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>> … … 24 27 <?php 25 28 $metadata = wp_get_attachment_metadata(); 26 printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ), 29 printf( 30 __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ), 27 31 esc_attr( get_the_date( 'c' ) ), 28 32 esc_html( get_the_date() ), … … 53 57 * 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 54 58 */ 55 $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); 59 $attachments = array_values( 60 get_children( 61 array( 62 'post_parent' => $post->post_parent, 63 'post_status' => 'inherit', 64 'post_type' => 'attachment', 65 'post_mime_type' => 'image', 66 'order' => 'ASC', 67 'orderby' => 'menu_order ID', 68 ) 69 ) 70 ); 56 71 foreach ( $attachments as $k => $attachment ) : 57 if ( $attachment->ID == $post->ID ) 72 if ( $attachment->ID == $post->ID ) { 58 73 break; 74 } 59 75 endforeach; 60 76 … … 74 90 endif; 75 91 ?> 76 <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php 77 /** 78 * Filter the image attachment size to use. 79 * 80 * @since Twenty Twelve 1.0 81 * 82 * @param array $size { 83 * @type int The attachment height in pixels. 84 * @type int The attachment width in pixels. 85 * } 86 */ 87 $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) ); 88 echo wp_get_attachment_image( $post->ID, $attachment_size ); 89 ?></a> 92 <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"> 93 <?php 94 /** 95 * Filter the image attachment size to use. 96 * 97 * @since Twenty Twelve 1.0 98 * 99 * @param array $size { 100 * @type int The attachment height in pixels. 101 * @type int The attachment width in pixels. 102 * } 103 */ 104 $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) ); 105 echo wp_get_attachment_image( $post->ID, $attachment_size ); 106 ?> 107 </a> 90 108 91 109 <?php if ( ! empty( $post->post_excerpt ) ) : ?> … … 100 118 <div class="entry-description"> 101 119 <?php the_content(); ?> 102 <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?> 120 <?php 121 wp_link_pages( 122 array( 123 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 124 'after' => '</div>', 125 ) 126 ); 127 ?> 103 128 </div><!-- .entry-description --> 104 129
Note: See TracChangeset
for help on using the changeset viewer.