author pages
-
I have created an author page so when an authors name is clicked they will go to the author page that firstly says:
Viewing all posts by abc_author:
then displays posts…
This all works great however for some reason it repeats the Viewing all posts by abc_author: at the top of every post instead of just appearing once at the top of the page. Here’s my template code:
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
if(isset($_GET['author_name'])) :
$curauth = get_userdatabylogin($_GET['author_name']);
else :
$curauth = get_userdata($_GET['author']);
endif;
?><h2 class="author">Viewing all posts by <?php echo $curauth->first_name; ?>:</h2>
<div id="post-<?php the_ID(); ?>" class="entry"> etc etc etc
Does anyone know how I can stop this repeating head and just get it to display once?
Thanks.
The topic ‘author pages’ is closed to new replies.