So, here is what I would like to do: when a reader clicks on a post title to read the whole thing, in that template there will be a div where all the posts by the author of the current post will be listed. Right now I’m trying to technique discussed here: http://codex.wordpress.org/Author_Templates but it’s not working. It’s only listing the current post. Here’s what my code currently looks like:
<div id="sidebar">
<?php
if(isset($_GET['author_name'])) :
$curauth = get_userdatabylogin($author_name); // NOTE: 2.0 bug requires get_userdatabylogin(get_the_author_login());
else :
$curauth = get_userdata(intval($author));
endif;
?>
<?php rewind_posts(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<ul><li>All posts by <?php echo $curauth->nickname; ?></li>
<h3>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<small><?php the_time('F jS, Y') ?> </small>
<?php endwhile; ?>
<?php else : ?>
<p>No posts by this author</p>
<?php endif; ?>
As I said, I want it to list all the posts by the author whose post you are currently reading, but right now it’s only listing the current one.