WordPress.org

Support

Support » How-To and Troubleshooting » My author.php loop isn’t working right

My author.php loop isn’t working right

  • Morning! I was looking over one of my sites last night and I have set up the author.php stuff and thought it was working properly, but I noticed that the loop is only displaying the authors last post. All of my sites are fairly new and I guess I screwed it up on all of them. I used the code directly from the codex. Can someone please check it out for me and let me know what I can chance to list all the authors posts on their page.

    Thanks
    ———————————————————–

    <!-- The Loop -->
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    # " rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
    <?php the_title(); ?>,
    <?php the_time('d M Y'); ?> in <?php the_category('&');?>
    
    <?php endwhile; else: ?>
    <p><?php _e('No posts by this author.'); ?></p>
    
    <?php endif; ?>
    <!-- End Loop -->

    ————————————————–

Viewing 4 replies - 1 through 4 (of 4 total)
  • better go back to the codex because you missed some code.

    <?php get_header(); ?>
       <div id="postbody">
          <!-- This sets the $curauth variable -->
    <?php
    if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;
    ?>
    <h2><?php echo $curauth->nickname; ?></h2>
    <dl>
    <dt></dt>
    <dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd>
    <dt></dt>
    <dd><?php echo $curauth->user_description; ?></dd>
    </dl><p>
    
    <h2>Posts:</h2>
    
    <ul>
    <!-- The Loop -->
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
      <li>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
    <?php the_title(); ?></a>,
    <?php the_time('d M Y'); ?> in <?php the_category('&');?>
      </li>
    
      <?php endwhile; else: ?>
         <p><?php _e('No posts by this author.'); ?></p>
    
    	<?php endif; ?>
    <!-- End Loop -->
    </ul>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    [edit]Including Profile Information

    sorry.. I am new to posting here and wasn’t sure how to add the code… the first post was regular ole copy and paste.

    sorry about that

    any ideas… would greatly be appreciated

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘My author.php loop isn’t working right’ is closed to new replies.