Make WordPress Core


Ignore:
Timestamp:
02/14/2010 10:02:38 AM (17 years ago)
Author:
dd32
Message:

Replace $authordata usage with API, Restore "Also posted in.."/"Also tagged..." on taxonomy archives, Handle Excerpts for Asides correctly on Archives. See #9015

File:
1 edited

Legend:

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

    r13141 r13147  
    1515                        <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a>
    1616                        <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>
    1818                </div><!-- .entry-meta -->
    1919
    … …  
    4747<?php } elseif ( in_category( 'asides' ) ) { ?>
    4848        <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     49<?php if ( is_archive() || is_search() ) : //Only display Excerpts for archives & search ?>
     50                <div class="entry-summary">
     51                        <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
     52                </div><!-- .entry-summary -->
     53<?php else : ?>
    4954                <div class="entry-content">
    5055                        <?php the_content( __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    5156                </div><!-- .entry-content -->
     57<?php endif; ?>
    5258
    5359                <div class="entry-utility">
    … …  
    5561                        <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a>
    5662                        <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>
    58                         <span class="meta-sep"><?php __( ' | ', 'twentyten' ); ?></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>
     64                        <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span>
    5965                        <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
    6066                        <?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" ); ?>
    … …  
    7278the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a>
    7379                        <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>
    7581                </div><!-- .entry-meta -->
    7682
    … …  
    8793
    8894                <div class="entry-utility">
    89                         <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>
    90                         <span class="meta-sep"><?php __( ' | ', 'twentyten' ); ?></span>
    91                         <?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" ); ?>
     95                        <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php echo twentyten_cat_list(); ?></span></span>
     96                        <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span>
     97                        <?php $tags_text = twentyten_tag_list(); ?>
     98                        <?php if ( !empty($tags_text) ) : ?>
     99                        <span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links"><?php echo $tags_text; ?></span></span>
     100                        <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span>
     101                        <?php endif; //$tags_text ?>
    92102                        <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
    93103                        <?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" ); ?>
Note: See TracChangeset for help on using the changeset viewer.