Permalink
Browse files

Merge pull request #64 from kovshenin/patch-7

Revert "Merge pull request #36 from kovshenin/patch-5" This will better match core practices for default themes as well as restore functionality of the 'the_author' filter. props @kovshenin
  • Loading branch information...
2 parents 2bfb5ef + 461976d commit 7fef5cd2ec9335e202de2557e9c9d77aed3635ab @mfields mfields committed Aug 31, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 archive.php
View
@@ -25,9 +25,16 @@
printf( __( 'Tag Archives: %s', '_s' ), '<span>' . single_tag_title( '', false ) . '</span>' );
} elseif ( is_author() ) {
- // Get the queried author data.
- $author = get_queried_object();
- printf( __( 'Author Archives: %s', '_s' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( $author->ID ) ) . '" title="' . esc_attr( $author->display_name ) . '" rel="me">' . esc_html( $author->display_name ) . '</a></span>' );
+ /* Queue the first post, that way we know
+ * what author we're dealing with (if that is the case).
+ */
+ the_post();
+ printf( __( 'Author Archives: %s', '_s' ), '<span class="vcard"><a class="url fn n" href="' . get_author_posts_url( get_the_author_meta( "ID" ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' );
+ /* Since we called the_post() above, we need to
+ * rewind the loop back to the beginning that way
+ * we can run the loop properly, in full.
+ */
+ rewind_posts();
} elseif ( is_day() ) {
printf( __( 'Daily Archives: %s', '_s' ), '<span>' . get_the_date() . '</span>' );

0 comments on commit 7fef5cd

Please sign in to comment.