WordPress.org

Ready to get started?Download WordPress

Forums

My author.php loop isn't working right (5 posts)

  1. tomaraa
    Member
    Posted 7 years ago #

    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 -->

    --------------------------------------------------

  2. Marcel Brinkkemper
    Member
    Posted 7 years ago #

    better go back to the codex because you missed some code.

  3. tomaraa
    Member
    Posted 7 years ago #

    <?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
  4. tomaraa
    Member
    Posted 7 years ago #

    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

  5. tomaraa
    Member
    Posted 7 years ago #

    any ideas... would greatly be appreciated

Topic Closed

This topic has been closed to new replies.

About this Topic