Skip to content

Commit

Permalink
Keep "by" from showing up when author is blank
Browse files Browse the repository at this point in the history
  • Loading branch information
query committed Mar 31, 2011
1 parent b5bfba6 commit 4d8f97c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions functions.php
Expand Up @@ -292,14 +292,17 @@ function bw_get_author() {
* @since Twenty Ten 1.0
*/
function twentyten_posted_on() {
printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
printf( __( '<span class="%1$s">Posted on</span> %2$s%3$s', 'twentyten' ),
'meta-prep meta-prep-author',
sprintf( '<a href="%1$s" rel="bookmark"><time datetime="%2$s" class="entry-date" pubdate>%3$s</time></a>',
get_permalink(),
esc_attr( get_the_time('c') ),
get_the_date()
),
bw_get_author()
(($author = bw_get_author()) ?
sprintf( __( ' <span class="meta-sep">by</span> %s', 'twentyten' ), $author ) :
''
)
);
}
endif;
Expand Down
2 changes: 1 addition & 1 deletion issue.php
Expand Up @@ -27,7 +27,7 @@
?>
<dt>
<a href="<?php echo the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
by <?php echo bw_get_author(); ?>
<?php if ($author = bw_get_author()) { ?>by <?php echo $author; } ?>
</dt>
<dd><?php echo get_post_meta($post->ID, 'excerpt', true); ?></dd>
<?php
Expand Down

0 comments on commit 4d8f97c

Please sign in to comment.