Ticket #15078: 15078.diff
File 15078.diff, 20.6 KB (added by , 14 years ago) |
---|
-
wp-content/themes/twentyten/loop-attachment.php
1 <?php 2 /** 3 * The loop that displays attachments. This overrides loop.php. 4 * 5 * The loop displays the posts and the post content. See 6 * http://codex.wordpress.org/The_Loop to understand it and 7 * http://codex.wordpress.org/Template_Tags to understand 8 * the tags used in it. 9 * 10 * This can be overridden in child themes with loop-attachment.php. 11 * 12 * @package WordPress 13 * @subpackage Twenty_Ten 14 * @since Twenty Ten 1.4 15 */ 16 ?> 17 18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 19 20 <?php if ( ! empty( $post->post_parent ) ) : ?> 21 <p class="page-title"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php 22 /* translators: %s - title of parent post */ 23 printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) ); 24 ?></a></p> 25 <?php endif; ?> 26 27 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 28 <h2 class="entry-title"><?php the_title(); ?></h2> 29 30 <div class="entry-meta"> 31 <?php 32 printf(__('<span class="%1$s">By</span> %2$s', 'twentyten'), 33 'meta-prep meta-prep-author', 34 sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', 35 get_author_posts_url( get_the_author_meta( 'ID' ) ), 36 sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ), 37 get_the_author() 38 ) 39 ); 40 ?> 41 <span class="meta-sep">|</span> 42 <?php 43 printf( __('<span class="%1$s">Published</span> %2$s', 'twentyten'), 44 'meta-prep meta-prep-entry-date', 45 sprintf( '<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>', 46 esc_attr( get_the_time() ), 47 get_the_date() 48 ) 49 ); 50 if ( wp_attachment_is_image() ) { 51 echo ' <span class="meta-sep">|</span> '; 52 $metadata = wp_get_attachment_metadata(); 53 printf( __( 'Full size is %s pixels', 'twentyten'), 54 sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>', 55 wp_get_attachment_url(), 56 esc_attr( __('Link to full-size image', 'twentyten') ), 57 $metadata['width'], 58 $metadata['height'] 59 ) 60 ); 61 } 62 ?> 63 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?> 64 </div><!-- .entry-meta --> 65 66 <div class="entry-content"> 67 <div class="entry-attachment"> 68 <?php if ( wp_attachment_is_image() ) : 69 $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' ) ) ); 70 foreach ( $attachments as $k => $attachment ) { 71 if ( $attachment->ID == $post->ID ) 72 break; 73 } 74 $k++; 75 // If there is more than 1 image attachment in a gallery 76 if ( count( $attachments ) > 1 ) { 77 if ( isset( $attachments[ $k ] ) ) 78 // get the URL of the next image attachment 79 $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 80 else 81 // or get the URL of the first image attachment 82 $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); 83 } else { 84 // or, if there's only 1 image attachment, get the URL of the image 85 $next_attachment_url = wp_get_attachment_url(); 86 } 87 ?> 88 <p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php 89 $attachment_size = apply_filters( 'twentyten_attachment_size', 900 ); 90 echo wp_get_attachment_image( $post->ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height. 91 ?></a></p> 92 93 <div id="nav-below" class="navigation"> 94 <div class="nav-previous"><?php previous_image_link( false ); ?></div> 95 <div class="nav-next"><?php next_image_link( false ); ?></div> 96 </div><!-- #nav-below --> 97 <?php else : ?> 98 <a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a> 99 <?php endif; ?> 100 </div><!-- .entry-attachment --> 101 <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div> 102 103 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> 104 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 105 106 </div><!-- .entry-content --> 107 108 <div class="entry-utility"> 109 <?php twentyten_posted_in(); ?> 110 <?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?> 111 </div><!-- .entry-utility --> 112 </div><!-- #post-## --> 113 114 <?php comments_template(); ?> 115 116 <?php endwhile; ?> -
wp-content/themes/twentyten/onecolumn-page.php
17 17 <div id="container" class="one-column"> 18 18 <div id="content" role="main"> 19 19 20 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 21 22 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 23 <h1 class="entry-title"><?php the_title(); ?></h1> 24 <div class="entry-content"> 25 <?php the_content(); ?> 26 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 27 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> 28 </div><!-- .entry-content --> 29 </div><!-- #post-## --> 30 31 <?php comments_template( '', true ); ?> 32 33 <?php endwhile; ?> 34 20 <?php 21 /* Run the loop to output the page. 22 * If you want to overload this in a child theme then include a file 23 * called loop-page.php and that will be used instead. 24 */ 25 get_template_part( 'loop', 'page' ); 26 ?> 35 27 </div><!-- #content --> 36 28 </div><!-- #container --> 37 29 -
wp-content/themes/twentyten/page.php
17 17 <div id="container"> 18 18 <div id="content" role="main"> 19 19 20 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 21 22 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 23 <?php if ( is_front_page() ) { ?> 24 <h2 class="entry-title"><?php the_title(); ?></h2> 25 <?php } else { ?> 26 <h1 class="entry-title"><?php the_title(); ?></h1> 27 <?php } ?> 28 29 <div class="entry-content"> 30 <?php the_content(); ?> 31 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 32 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> 33 </div><!-- .entry-content --> 34 </div><!-- #post-## --> 35 36 <?php comments_template( '', true ); ?> 37 38 <?php endwhile; ?> 39 20 <?php 21 /* Run the loop to output the page. 22 * If you want to overload this in a child theme then include a file 23 * called loop-page.php and that will be used instead. 24 */ 25 get_template_part( 'loop', 'page' ); 26 ?> 40 27 </div><!-- #content --> 41 28 </div><!-- #container --> 42 29 -
wp-content/themes/twentyten/single.php
12 12 <div id="container"> 13 13 <div id="content" role="main"> 14 14 15 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 16 17 <div id="nav-above" class="navigation"> 18 <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> 19 <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div> 20 </div><!-- #nav-above --> 21 22 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 23 <h1 class="entry-title"><?php the_title(); ?></h1> 24 25 <div class="entry-meta"> 26 <?php twentyten_posted_on(); ?> 27 </div><!-- .entry-meta --> 28 29 <div class="entry-content"> 30 <?php the_content(); ?> 31 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 32 </div><!-- .entry-content --> 33 34 <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?> 35 <div id="entry-author-info"> 36 <div id="author-avatar"> 37 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?> 38 </div><!-- #author-avatar --> 39 <div id="author-description"> 40 <h2><?php printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2> 41 <?php the_author_meta( 'description' ); ?> 42 <div id="author-link"> 43 <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"> 44 <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten' ), get_the_author() ); ?> 45 </a> 46 </div><!-- #author-link --> 47 </div><!-- #author-description --> 48 </div><!-- #entry-author-info --> 49 <?php endif; ?> 50 51 <div class="entry-utility"> 52 <?php twentyten_posted_in(); ?> 53 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> 54 </div><!-- .entry-utility --> 55 </div><!-- #post-## --> 56 57 <div id="nav-below" class="navigation"> 58 <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> 59 <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div> 60 </div><!-- #nav-below --> 61 62 <?php comments_template( '', true ); ?> 63 64 <?php endwhile; // end of the loop. ?> 65 15 <?php 16 /* Run the loop to output the post. 17 * If you want to overload this in a child theme then include a file 18 * called loop-single.php and that will be used instead. 19 */ 20 get_template_part( 'loop', 'single' ); 21 ?> 66 22 </div><!-- #content --> 67 23 </div><!-- #container --> 68 24 -
wp-content/themes/twentyten/loop-page.php
1 <?php 2 /** 3 * The loop that displays pages. This overrides loop.php. 4 * 5 * The loop displays the posts and the post content. See 6 * http://codex.wordpress.org/The_Loop to understand it and 7 * http://codex.wordpress.org/Template_Tags to understand 8 * the tags used in it. 9 * 10 * This can be overridden in child themes with loop-page.php. 11 * 12 * @package WordPress 13 * @subpackage Twenty_Ten 14 * @since Twenty Ten 1.4 15 */ 16 ?> 17 18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 19 20 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 21 <?php if ( is_front_page() ) { ?> 22 <h2 class="entry-title"><?php the_title(); ?></h2> 23 <?php } else { ?> 24 <h1 class="entry-title"><?php the_title(); ?></h1> 25 <?php } ?> 26 27 <div class="entry-content"> 28 <?php the_content(); ?> 29 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 30 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> 31 </div><!-- .entry-content --> 32 </div><!-- #post-## --> 33 34 <?php comments_template( '', true ); ?> 35 36 <?php endwhile; ?> 37 No newline at end of file -
wp-content/themes/twentyten/attachment.php
12 12 <div id="container" class="single-attachment"> 13 13 <div id="content" role="main"> 14 14 15 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 16 17 <?php if ( ! empty( $post->post_parent ) ) : ?> 18 <p class="page-title"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php 19 /* translators: %s - title of parent post */ 20 printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) ); 21 ?></a></p> 22 <?php endif; ?> 23 24 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 25 <h2 class="entry-title"><?php the_title(); ?></h2> 26 27 <div class="entry-meta"> 28 <?php 29 printf(__('<span class="%1$s">By</span> %2$s', 'twentyten'), 30 'meta-prep meta-prep-author', 31 sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', 32 get_author_posts_url( get_the_author_meta( 'ID' ) ), 33 sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ), 34 get_the_author() 35 ) 36 ); 37 ?> 38 <span class="meta-sep">|</span> 39 <?php 40 printf( __('<span class="%1$s">Published</span> %2$s', 'twentyten'), 41 'meta-prep meta-prep-entry-date', 42 sprintf( '<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>', 43 esc_attr( get_the_time() ), 44 get_the_date() 45 ) 46 ); 47 if ( wp_attachment_is_image() ) { 48 echo ' <span class="meta-sep">|</span> '; 49 $metadata = wp_get_attachment_metadata(); 50 printf( __( 'Full size is %s pixels', 'twentyten'), 51 sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>', 52 wp_get_attachment_url(), 53 esc_attr( __('Link to full-size image', 'twentyten') ), 54 $metadata['width'], 55 $metadata['height'] 56 ) 57 ); 58 } 59 ?> 60 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?> 61 </div><!-- .entry-meta --> 62 63 <div class="entry-content"> 64 <div class="entry-attachment"> 65 <?php if ( wp_attachment_is_image() ) : 66 $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' ) ) ); 67 foreach ( $attachments as $k => $attachment ) { 68 if ( $attachment->ID == $post->ID ) 69 break; 70 } 71 $k++; 72 // If there is more than 1 image attachment in a gallery 73 if ( count( $attachments ) > 1 ) { 74 if ( isset( $attachments[ $k ] ) ) 75 // get the URL of the next image attachment 76 $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 77 else 78 // or get the URL of the first image attachment 79 $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); 80 } else { 81 // or, if there's only 1 image attachment, get the URL of the image 82 $next_attachment_url = wp_get_attachment_url(); 83 } 84 ?> 85 <p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php 86 $attachment_size = apply_filters( 'twentyten_attachment_size', 900 ); 87 echo wp_get_attachment_image( $post->ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height. 88 ?></a></p> 89 90 <div id="nav-below" class="navigation"> 91 <div class="nav-previous"><?php previous_image_link( false ); ?></div> 92 <div class="nav-next"><?php next_image_link( false ); ?></div> 93 </div><!-- #nav-below --> 94 <?php else : ?> 95 <a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a> 96 <?php endif; ?> 97 </div><!-- .entry-attachment --> 98 <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div> 99 100 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> 101 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 102 103 </div><!-- .entry-content --> 104 105 <div class="entry-utility"> 106 <?php twentyten_posted_in(); ?> 107 <?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?> 108 </div><!-- .entry-utility --> 109 </div><!-- #post-## --> 110 111 <?php comments_template(); ?> 112 113 <?php endwhile; ?> 114 15 <?php 16 /* Run the loop to output the attachments. 17 * If you want to overload this in a child theme then include a file 18 * called loop-attachment.php and that will be used instead. 19 */ 20 get_template_part( 'loop', 'attachment' ); 21 ?> 115 22 </div><!-- #content --> 116 23 </div><!-- #container --> 117 24 -
wp-content/themes/twentyten/loop-single.php
1 <?php 2 /** 3 * The loop that displays single posts. This overrides loop.php. 4 * 5 * The loop displays the posts and the post content. See 6 * http://codex.wordpress.org/The_Loop to understand it and 7 * http://codex.wordpress.org/Template_Tags to understand 8 * the tags used in it. 9 * 10 * This can be overridden in child themes with loop-single.php. 11 * 12 * @package WordPress 13 * @subpackage Twenty_Ten 14 * @since Twenty Ten 1.4 15 */ 16 ?> 17 18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 19 20 <div id="nav-above" class="navigation"> 21 <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> 22 <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div> 23 </div><!-- #nav-above --> 24 25 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 26 <h1 class="entry-title"><?php the_title(); ?></h1> 27 28 <div class="entry-meta"> 29 <?php twentyten_posted_on(); ?> 30 </div><!-- .entry-meta --> 31 32 <div class="entry-content"> 33 <?php the_content(); ?> 34 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 35 </div><!-- .entry-content --> 36 37 <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?> 38 <div id="entry-author-info"> 39 <div id="author-avatar"> 40 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?> 41 </div><!-- #author-avatar --> 42 <div id="author-description"> 43 <h2><?php printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2> 44 <?php the_author_meta( 'description' ); ?> 45 <div id="author-link"> 46 <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"> 47 <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten' ), get_the_author() ); ?> 48 </a> 49 </div><!-- #author-link --> 50 </div><!-- #author-description --> 51 </div><!-- #entry-author-info --> 52 <?php endif; ?> 53 54 <div class="entry-utility"> 55 <?php twentyten_posted_in(); ?> 56 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> 57 </div><!-- .entry-utility --> 58 </div><!-- #post-## --> 59 60 <div id="nav-below" class="navigation"> 61 <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> 62 <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div> 63 </div><!-- #nav-below --> 64 65 <?php comments_template( '', true ); ?> 66 67 <?php endwhile; // end of the loop. ?> 68 No newline at end of file