WordPress.org

Make WordPress Core

Changeset 13141


Ignore:
Timestamp:
02/14/10 07:13:34 (4 years ago)
Author:
dd32
Message:

Move the Loop into a separate file. Reduces code duplication and adds Gallery/Aside styling to all archive views. See #9015

Location:
trunk/wp-content/themes/twentyten
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/archive.php

    r13128 r13141  
    1212<?php elseif ( is_year() ) : ?> 
    1313                <h1 class="page-title"><?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date('Y') ); ?></h1> 
    14 <?php elseif ( isset($_GET['paged']) && !empty($_GET['paged']) ) : ?> 
     14<?php else : ?> 
    1515                <h1 class="page-title"><?php _e( 'Blog Archives', 'twentyten' ); ?></h1> 
    1616<?php endif; ?> 
     
    1818<?php rewind_posts(); ?> 
    1919 
    20 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    21                 <div id="nav-above" class="navigation"> 
    22                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    23                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    24                 </div><!-- #nav-above --> 
    25 <?php } ?> 
    26  
    27 <?php while ( have_posts() ) : the_post(); ?> 
    28  
    29                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    30                     <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> 
    31  
    32                     <div class="entry-meta"> 
    33                         <span class="meta-prep meta-prep-author"><?php _e('Posted on ', 'twentyten'); ?></span> 
    34                         <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 
    35                         <span class="meta-sep"><?php _e(' by ', 'twentyten'); ?></span> 
    36                         <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 
    37                     </div><!-- .entry-meta --> 
    38  
    39                     <div class="entry-summary"> 
    40 <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' )  ); ?> 
    41                     </div><!-- .entry-summary --> 
    42  
    43                     <div class="entry-utility"> 
    44                         <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php echo get_the_category_list(', '); ?></span> 
    45                         <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span> 
    46                         <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'twentyten' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ); ?> 
    47                         <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 
    48                         <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> 
    49                     </div><!-- #entry-utility --> 
    50                 </div><!-- #post-<?php the_ID(); ?> --> 
    51  
    52 <?php endwhile; ?> 
    53  
    54 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    55                 <div id="nav-below" class="navigation"> 
    56                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    57                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    58                 </div><!-- #nav-below --> 
    59 <?php } ?> 
     20<?php include 'loop.php'; ?> 
    6021 
    6122            </div><!-- #content --> 
  • trunk/wp-content/themes/twentyten/author.php

    r13128 r13141  
    66<?php the_post(); ?> 
    77 
    8                 <h1 class="page-title author"><?php printf( __( 'Author Archives: <span class="vcard">%s</span>', 'twentyten' ), "<a class='url fn n' href='$authordata->user_url' title='" . esc_attr($authordata->display_name) . "' rel='me'>" . esc_html($authordata->display_name) . "</a>" ); ?></h1> 
     8                <h1 class="page-title author"><?php printf( __( 'Author Archives: <span class="vcard">%s</span>', 'twentyten' ), "<a class='url fn n' href='$authordata->user_url' title='" . esc_attr(get_the_author()) . "' rel='me'>" . get_the_author() . "</a>" ); ?></h1> 
    99 
    1010<?php if ( get_the_author_meta('description') ) : // If a user has filled out their decscription show a bio on their entries  ?> 
     
    1414                        </div><!-- #author-avatar   --> 
    1515                        <div id="author-description"> 
    16                             <h2><?php _e('About ', 'twentyten'); ?><?php the_author(); ?></h2> 
     16                            <h2><?php printf(__('About %s', 'twentyten'), get_the_author()); ?></h2> 
    1717                            <?php the_author_meta('description'); ?> 
    1818                        </div><!-- #author-description  --> 
     
    2222<?php rewind_posts(); ?> 
    2323 
    24 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    25                 <div id="nav-above" class="navigation"> 
    26                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    27                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    28                 </div><!-- #nav-above --> 
    29 <?php } ?> 
    30  
    31 <?php while ( have_posts() ) : the_post(); ?> 
    32  
    33                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    34                     <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> 
    35  
    36                     <div class="entry-meta"> 
    37                         <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span> 
    38                         <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 
    39                     </div><!-- .entry-meta --> 
    40  
    41                     <div class="entry-summary"> 
    42                         <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' )  ); ?> 
    43                     </div><!-- .entry-summary --> 
    44  
    45                     <div class="entry-utility"> 
    46                         <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php echo get_the_category_list( ', ' ); ?></span> 
    47                         <span class="meta-sep"> | </span> 
    48                         <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'twentyten' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ); ?> 
    49                         <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 
    50                         <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> 
    51                     </div><!-- #entry-utility --> 
    52                 </div><!-- #post-<?php the_ID(); ?> --> 
    53  
    54 <?php endwhile; ?> 
    55  
    56 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    57                 <div id="nav-below" class="navigation"> 
    58                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    59                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    60                 </div><!-- #nav-below --> 
    61 <?php } ?> 
     24<?php include 'loop.php'; ?> 
    6225 
    6326            </div><!-- #content --> 
  • trunk/wp-content/themes/twentyten/category.php

    r13128 r13141  
    1111<?php rewind_posts(); ?> 
    1212 
    13 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    14                 <div id="nav-above" class="navigation"> 
    15                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    16                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    17                 </div><!-- #nav-above --> 
    18 <?php } ?> 
    19  
    20 <?php while ( have_posts() ) : the_post(); ?> 
    21  
    22                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    23                     <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> 
    24  
    25                     <div class="entry-meta"> 
    26                         <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span> 
    27                         <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 
    28                         <span class="meta-sep"><?php _e(' by ', 'twentyten'); ?></span> 
    29                         <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 
    30                     </div><!-- .entry-meta --> 
    31  
    32                     <div class="entry-summary"> 
    33                         <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?> 
    34                     </div><!-- .entry-summary --> 
    35  
    36                     <div class="entry-utility"> 
    37 <?php if ( $cats_meow = cats_meow( ', ' ) ) : // Returns categories other than the one queried ?> 
    38                         <span class="cat-links"><?php printf( __( 'Also posted in %s', 'twentyten' ), $cats_meow ); ?></span> 
    39                         <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span> 
    40 <?php endif ?> 
    41                         <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'twentyten' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ); ?> 
    42                         <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 
    43                         <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> 
    44                     </div><!-- #entry-utility --> 
    45                 </div><!-- #post-<?php the_ID(); ?> --> 
    46  
    47 <?php endwhile; ?> 
    48  
    49 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    50                 <div id="nav-below" class="navigation"> 
    51                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    52                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    53                 </div><!-- #nav-below --> 
    54 <?php } ?> 
     13<?php include 'loop.php'; ?> 
    5514 
    5615            </div><!-- #content --> 
  • trunk/wp-content/themes/twentyten/footer.php

    r13138 r13141  
    77 
    88            <div id="site-info"> 
    9                 <a href="<?php echo home_url() ?>/" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a> 
     9                <a href="<?php echo home_url('/') ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a> 
    1010            </div> 
    1111 
  • trunk/wp-content/themes/twentyten/header.php

    r13138 r13141  
    4040 
    4141            <div id="branding"> 
    42                 <div id="site-title"><span><a href="<?php echo home_url(); ?>/" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></div> 
     42                <div id="site-title"><span><a href="<?php echo home_url('/'); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></div> 
    4343                <div id="site-description"><?php bloginfo( 'description' ); ?></div> 
    4444 
    4545                <?php 
    46                     global $post; 
    47                     if ( is_singular() && has_post_thumbnail( $post->ID ) ) { 
    48                         echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 
    49                     } else { ?> 
     46                if ( is_singular() && has_post_thumbnail( $post->ID ) ) { 
     47                    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 
     48                } else { ?> 
    5049                    <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> 
    5150                <?php } ?> 
  • trunk/wp-content/themes/twentyten/index.php

    r13128 r13141  
    44            <div id="content"> 
    55 
    6 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    7                 <div id="nav-above" class="navigation"> 
    8                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    9                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    10                 </div><!-- #nav-above --> 
    11 <?php } ?> 
    12  
    13     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> 
    14     <?php if ( in_category( 'Gallery' ) ) { ?> 
    15         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    16             <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> 
    17  
    18             <div class="entry-meta"> 
    19                 <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span> 
    20                 <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 
    21                 <span class="meta-sep"> <?php _e( 'by ', 'twentyten' ); ?> </span> 
    22                 <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 
    23             </div><!-- .entry-meta --> 
    24  
    25             <div class="entry-content"> 
    26                 <div class="gallery-thumb"> 
    27                     <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php 
    28                     $images =& get_children( array('post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999) ); 
    29                     $total_images = count($images); 
    30                     $image = array_shift($images); 
    31                     echo wp_get_attachment_image( $image->ID, 'thumbnail' ); 
    32                     ?></a> 
    33                 </div> 
    34                 <p><em><?php printf( __('This gallery contains <a %1$s>%2$s photos</a>.', 'twentyten'), 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ) . '" rel="bookmark"', $total_images ); ?></em></p> 
    35  
    36                 <?php the_excerpt( '' ); ?> 
    37             </div><!-- .entry-content --> 
    38  
    39             <div class="entry-utility"> 
    40                 <?php 
    41                     $category_id = get_cat_ID( 'Gallery' ); 
    42                     $category_link = get_category_link( $category_id ); 
    43                 ?> 
    44                 <a href="<?php echo $category_link; ?>" title="<?php esc_attr_e('View posts in the Gallery category', 'twentyten'); ?>"><?php _e('More Galleries', 'twentyten'); ?></a> 
    45                 <span class="meta-sep"><?php __( ' | ', 'twentyten' ); ?></span> 
    46                 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 
    47                 <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> 
    48             </div><!-- #entry-utility --> 
    49         </div> 
    50  
    51  
    52     <?php } elseif ( in_category( 'asides' ) ) { ?> 
    53         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    54             <div class="entry-content"> 
    55                 <?php the_content( __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?> 
    56             </div><!-- .entry-content --> 
    57  
    58             <div class="entry-utility"> 
    59                 <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span> 
    60                 <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 
    61                 <span class="meta-sep"> <?php _e( 'by ', 'twentyten' ); ?> </span> 
    62                 <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 
    63                 <span class="meta-sep"><?php __( ' | ', 'twentyten' ); ?></span> 
    64                 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 
    65                 <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> 
    66             </div><!-- #entry-utility --> 
    67         </div><!-- #post-<?php the_ID(); ?> --> 
    68  
    69  
    70     <?php } else { ?> 
    71         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    72             <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> 
    73  
    74             <div class="entry-meta"> 
    75                 <span class="meta-prep meta-prep-author"><?php _e('Posted on ', 'twentyten'); ?></span> 
    76                 <a href="<?php 
    77 the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 
    78                 <span class="meta-sep"><?php _e( ' by ', 'twentyten' ); ?></span> 
    79                 <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 
    80             </div><!-- .entry-meta --> 
    81  
    82             <div class="entry-content"> 
    83                 <?php the_content( __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?> 
    84                 <?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'twentyten' ) . '&after=</div>'); ?> 
    85             </div><!-- .entry-content --> 
    86  
    87             <div class="entry-utility"> 
    88                 <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php echo get_the_category_list( ', ' ); ?></span> 
    89                 <span class="meta-sep"><?php __( ' | ', 'twentyten' ); ?></span> 
    90                 <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'twentyten' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ); ?> 
    91                 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 
    92                 <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> 
    93             </div><!-- #entry-utility --> 
    94         </div><!-- #post-<?php the_ID(); ?> --> 
    95  
    96         <?php comments_template( '', true ); ?> 
    97  
    98     <?php } ?> 
    99     <?php endwhile; ?> 
    100     <?php else : ?> 
     6    <?php if ( have_posts() ) :  
     7        include 'loop.php'; 
     8    else : ?> 
    1019        <h2><?php _e( 'Not Found', 'twentyten' ); ?></h2> 
    10210        <div class="entry-content"> 
     
    10614    <?php endif; ?> 
    10715 
    108 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    109                 <div id="nav-below" class="navigation"> 
    110                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    111                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    112                 </div><!-- #nav-below --> 
    113 <?php } ?> 
    114  
    11516            </div><!-- #content --> 
    11617        </div><!-- #container --> 
  • trunk/wp-content/themes/twentyten/search.php

    r13128 r13141  
    55 
    66<?php if ( have_posts() ) : ?> 
    7  
    87                <h1 class="page-title"><?php _e( 'Search Results for: ', 'twentyten' ); ?><span><?php the_search_query(); ?></span></h1> 
    9  
    10 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    11                 <div id="nav-above" class="navigation"> 
    12                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    13                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    14                 </div><!-- #nav-above --> 
    15 <?php } ?> 
    16  
    17 <?php while ( have_posts() ) : the_post(); ?> 
    18  
    19                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    20                     <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> 
    21  
    22 <?php if ( $post->post_type != 'page' ) : ?> 
    23                     <div class="entry-meta"> 
    24                         <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span> 
    25                         <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 
    26                         <span class="meta-sep"> <?php _e( 'by ', 'twentyten' ); ?> </span> 
    27                         <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 
    28                     </div><!-- .entry-meta --> 
    29 <?php endif; ?> 
    30  
    31                     <div class="entry-summary"> 
    32                         <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?> 
    33                         <?php wp_link_pages( 'before=<div class="page-link">' . __( 'Pages:', 'twentyten' ) . '&after=</div>' ); ?> 
    34                     </div><!-- .entry-summary --> 
    35  
    36 <?php if ( $post->post_type != 'page' ) : ?> 
    37                     <div class="entry-utility"> 
    38                         <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php echo get_the_category_list(', '); ?></span> 
    39                         <span class="meta-sep"> | </span> 
    40                         <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'twentyten' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ); ?> 
    41                         <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 
    42                         <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> 
    43                     </div><!-- #entry-utility --> 
    44 <?php endif; ?> 
    45                 </div><!-- #post-<?php the_ID(); ?> --> 
    46  
    47 <?php endwhile; ?> 
    48  
    49 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    50                 <div id="nav-below" class="navigation"> 
    51                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    52                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    53                 </div><!-- #nav-below --> 
    54 <?php } ?> 
    55  
     8    <?php include 'loop.php'; ?> 
    569<?php else : ?> 
    57  
    5810                <div id="post-0" class="post no-results not-found"> 
    5911                    <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2> 
     
    6315                    </div><!-- .entry-content --> 
    6416                </div> 
    65  
    6617<?php endif; ?> 
    67  
    6818            </div><!-- #content --> 
    6919        </div><!-- #container --> 
  • trunk/wp-content/themes/twentyten/tag.php

    r13128 r13141  
    1010<?php rewind_posts(); ?> 
    1111 
    12 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    13                 <div id="nav-above" class="navigation"> 
    14                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    15                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    16                 </div><!-- #nav-above --> 
    17 <?php } ?> 
    18  
    19 <?php while ( have_posts() ) : the_post(); ?> 
    20  
    21                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 
    22                     <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> 
    23  
    24                     <div class="entry-meta"> 
    25                         <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span> 
    26                         <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 
    27                         <span class="meta-sep"><?php _e( ' by ', 'twentyten' ); ?></span> 
    28                         <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 
    29                     </div><!-- .entry-meta --> 
    30  
    31                     <div class="entry-summary"> 
    32                         <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?> 
    33                     </div><!-- .entry-summary --> 
    34  
    35                     <div class="entry-utility"> 
    36                         <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php echo get_the_category_list( ', ' ); ?></span> 
    37                         <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span> 
    38 <?php if ( $tag_ur_it = tag_ur_it(', ') ) : // Returns tags other than the one queried ?> 
    39                         <span class="tag-links"><?php printf( __( 'Also tagged %s', 'twentyten' ), $tag_ur_it ); ?></span> 
    40 <?php endif; ?> 
    41                         <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 
    42                         <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?> 
    43                     </div><!-- #entry-utility --> 
    44                 </div><!-- #post-<?php the_ID(); ?> --> 
    45  
    46 <?php endwhile; ?> 
    47  
    48 <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?> 
    49                 <div id="nav-below" class="navigation"> 
    50                     <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' )); ?></div> 
    51                     <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' )); ?></div> 
    52                 </div><!-- #nav-below --> 
    53 <?php } ?> 
     12<?php include 'loop.php'; ?> 
    5413 
    5514            </div><!-- #content --> 
Note: See TracChangeset for help on using the changeset viewer.