Ticket #9015: 9015.get_loop.diff
| File 9015.get_loop.diff, 10.4 KB (added by , 16 years ago) |
|---|
-
wp-content/themes/twentyten/archive.php
17 17 18 18 <?php rewind_posts(); ?> 19 19 20 <?php include 'loop.php'; ?>20 <?php get_loop('excerpt'); ?> 21 21 22 22 </div><!-- #content --> 23 23 </div><!-- #container --> -
wp-content/themes/twentyten/author.php
21 21 22 22 <?php rewind_posts(); ?> 23 23 24 <?php include 'loop.php'; ?>24 <?php get_loop('excerpt'); ?> 25 25 26 26 </div><!-- #content --> 27 27 </div><!-- #container --> -
wp-content/themes/twentyten/category.php
10 10 11 11 <?php rewind_posts(); ?> 12 12 13 <?php include 'loop.php'; ?>13 <?php get_loop('excerpt'); ?> 14 14 15 15 </div><!-- #content --> 16 16 </div><!-- #container --> -
wp-content/themes/twentyten/index.php
4 4 <div id="content"> 5 5 6 6 <?php if ( have_posts() ) : 7 include 'loop.php';7 get_loop(); 8 8 else : ?> 9 9 <h2><?php _e( 'Not Found', 'twentyten' ); ?></h2> 10 10 <div class="entry-content"> -
wp-content/themes/twentyten/loop.php
14 14 <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span> 15 15 <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 16 16 <span class="meta-sep"> <?php _e( 'by ', 'twentyten' ); ?> </span> 17 <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>17 <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 18 18 </div><!-- .entry-meta --> 19 19 20 20 <div class="entry-content"> … … 46 46 47 47 <?php } elseif ( in_category( 'asides' ) ) { ?> 48 48 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 49 <?php if ( is_named_loop('excerpt') ) : ?> 50 <div class="entry-summary"> 51 <?php the_excerpt( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> 52 </div><!-- .entry-summary --> 53 <?php else : ?> 49 54 <div class="entry-content"> 50 55 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> 51 56 </div><!-- .entry-content --> 57 <?php endif; ?> 52 58 53 59 <div class="entry-utility"> 54 60 <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span> 55 61 <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 56 62 <span class="meta-sep"> <?php _e( ' by ', 'twentyten' ); ?> </span> 57 <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="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 58 64 <span class="meta-sep"><?php __( ' | ', 'twentyten' ); ?></span> 59 65 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 60 66 <?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" ); ?> … … 71 77 <a href="<?php 72 78 the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 73 79 <span class="meta-sep"><?php _e( ' by ', 'twentyten' ); ?></span> 74 <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 <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 75 81 </div><!-- .entry-meta --> 76 82 77 <?php if ( is_ archive() || is_search() ) : //Only display Excerpts for archives & search?>83 <?php if ( is_named_loop('excerpt') ) : ?> 78 84 <div class="entry-summary"> 79 <?php the_excerpt( __( 'Continue reading<span class="meta-nav">→</span>', 'twentyten' ) ); ?>85 <?php the_excerpt( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> 80 86 </div><!-- .entry-summary --> 81 87 <?php else : ?> 82 88 <div class="entry-content"> -
wp-content/themes/twentyten/search.php
5 5 6 6 <?php if ( have_posts() ) : ?> 7 7 <h1 class="page-title"><?php _e( 'Search Results for: ', 'twentyten' ); ?><span><?php the_search_query(); ?></span></h1> 8 <?php include 'loop.php'; ?>8 <?php get_loop('excerpt'); ?> 9 9 <?php else : ?> 10 10 <div id="post-0" class="post no-results not-found"> 11 11 <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2> -
wp-content/themes/twentyten/single.php
15 15 16 16 <div class="entry-meta"> 17 17 <span class="meta-prep meta-prep-author"><?php _e( 'Posted by ', 'twentyten' ); ?></span> 18 <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID, $authordata->user_nicename); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>18 <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span> 19 19 <span class="meta-sep"><?php _e( ' on ', 'twentyten' ); ?> </span> 20 20 <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a> 21 21 <?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" ); ?> … … 35 35 <h2><?php _e( 'About ', 'twentyten' ); ?><?php the_author(); ?></h2> 36 36 <?php the_author_meta('description'); ?> 37 37 <div id="author-link"> 38 <a href="<?php echo get_author_posts_url( $authordata->ID); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php _e( 'View all posts by ', 'twentyten' ); ?><?php the_author(); ?> →</a>38 <a href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php _e( 'View all posts by ', 'twentyten' ); ?><?php the_author(); ?> →</a> 39 39 </div><!-- #author-link --> 40 40 </div><!-- #author-description --> 41 41 </div><!-- .entry-author-info --> -
wp-content/themes/twentyten/tag.php
9 9 10 10 <?php rewind_posts(); ?> 11 11 12 <?php include 'loop.php'; ?>12 <?php get_loop('excerpt'); ?> 13 13 14 14 </div><!-- #content --> 15 15 </div><!-- #container --> -
wp-includes/general-template.php
94 94 } 95 95 96 96 /** 97 * Load loop template. 98 * 99 * Includes the loop template for a theme or if a name is specified then a 100 * specialised loop will be included. 101 * 102 * For the parameter, if the file is called "loop-special.php" then specify 103 * "special". 104 * 105 * @uses locate_template() 106 * @global $_template_loop 107 * @since 3.0 108 * @uses do_action() Calls 'get_loop' action. 109 * 110 * @param string $name (optional) The name of the specialised loop. 111 */ 112 function get_loop( $name = null ) { 113 global $_template_loop; 114 $_template_loop = $name; 115 do_action( 'get_loop', $name ); 116 117 $templates = array(); 118 if ( isset($name) ) 119 $templates[] = "loop-{$name}.php"; 120 121 $templates[] = "loop.php"; 122 123 $templates = apply_filters('get_loop_templates', $templates, $name); 124 125 return locate_template($templates, true); 126 } 127 128 /** 129 * Check to see if Current Loop is a named loop 130 * 131 * For the parameter, if the file is called "loop-special.php" then specify 132 * "special". 133 * 134 * @global $_template_loop 135 * @since 3.0 136 * 137 * @param string $name (optional) The name of the specialised loop. 138 * @return bool If its that named loop or not. 139 */ 140 function is_named_loop($name = null) { 141 global $_template_loop; 142 return ($_template_loop == $name); 143 } 144 145 /** 97 146 * Display search form. 98 147 * 99 148 * Will first attempt to locate the searchform.php file in either the child or