Hello.
I'm using a modified twentyten with wordpress 3.0.1.
I'm trying to show the author's profile and links when the author's name link is clicked in a post. It only works when I'm using the default permalinks, and even then I only get the last post.
My permalink structure: /%year%/%monthnum%/%postname%/
What I want is to show their profile and all links when their name is clicked. I don't want a special page to be created for this purpose, like in this example.
What I would like to get is something like this.
This is how my author.php looks like:
<?php
get_header(); ?>
<div id="container">
<div id="content" role="main">
<?php
if ( have_posts() )
the_post();
?>
<h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyten' ), "<span class='vcard'><a title='" . esc_attr( get_the_author() ) . "' rel='me'>" . get_the_author() . "</a></span>" ); ?>
</h1>
<?php
if ( get_the_author_meta( 'description' ) ) : ?>
<div id="entry-author-info">
<div id="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email', $author->post_author ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
</div>
<div id="author-description">
<h2><?php printf( __( 'About %s', 'twentyten' ), get_the_author() ); ?>
</h2>
<?php the_author_meta( 'description' ); ?>
</div>
</div>
<?php endif; ?>
<?php
rewind_posts();
get_template_part( 'loop', 'author' );
?>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
And this is the part of the loop.php that (I think) matters:
<?php ?>
<?php /* Display navigation to next/previous pages when applicable */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
</div>
<?php endif; ?>
<?php /* If no posts to display, such as an empty archive page */ ?>
<?php if ( ! have_posts() ) : ?>
<div id="post-0" class="post error404 not-found">
<h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyten' ); ?></p>
<?php get_search_form(); ?>
</div>
</div>
<?php endif; ?>
<?php /* Start the Loop. */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php /* Display all posts. */ ?>
<?php else : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="entry-meta">
<p><br />Published on <?php the_time('F jS, Y') ?>, by <?php printf( __( ' %s', 'twentyten' ), "<span class='vcard'><a title='" . esc_attr( get_the_author() ) . "' rel='me'>" . get_the_author() . "</a></span>" ); ?>.</p></p>
</div></p>
<?php if ( is_archive() || is_search() ) : // Excerpts for archives and search. ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
</div>
<?php endif; ?>
<div class="entry-utility">
<?php if ( count( get_the_category() ) ) : ?>
<span class="cat-links">
<?php printf( __( '<span class="%1$s">Category: </span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
</span>
<span class="meta-sep">|</span>
<?php endif; ?>
<?php
$tags_list = get_the_tag_list( '', ', ' );
if ( $tags_list ):
?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Post Tags:</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
</span>
</div>
</div>
<?php comments_template( '', true ); ?>
<?php endif; // The if statement that broke the loop into three parts based on categories. ?>
<?php endwhile; // End the loop. ?>
<?php /* Navigation to next/previous pages. */ ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div id="nav-below" class="navigation">
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
</div>
<?php endif; ?>
I removed the comments-link and edit-post-link because I don't want to offer that facility. I'm sorry for having to post all that code, but I couldn't see a better way of explaining my issues.
So, I would be grateful if anyone could help me out here.
Regards,
Bob