_s: Simplify author template.

Set up author data for the author template immediately, rather than
waiting for the first the_post() call.
This removes the need to call the_post() and rewind_posts() in an
author template to print information about the author.

Fixes #346.
This commit is contained in:
obenland 2013-12-21 00:00:25 -08:00
parent 678e136006
commit a156f2cbab
2 changed files with 21 additions and 9 deletions

View file

@ -24,16 +24,7 @@ get_header(); ?>
single_tag_title();
elseif ( is_author() ) :
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*/
the_post();
printf( __( 'Author: %s', '_s' ), '<span class="vcard">' . get_the_author() . '</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( __( 'Day: %s', '_s' ), '<span>' . get_the_date() . '</span>' );