• Hey,

    I’m trying to build an archive template which displays the post author and bio next to the post. The archive will hold posts by multiple authors. So far I’ve got this:

    <?php
    if(isset($_GET['author_name'])) :
        // NOTE: 2.0 bug requires: get_userdatabylogin(get_the_author_login());
        $curauth = get_userdatabylogin($author_name);
    else :
        $curauth = get_userdata(intval($author));
    endif;
    ?>
    	<div id="authorbox">
      <?php echo get_avatar( $curauth->ID , 120 ); ?>
        <div class="authortext">
           <h4>An article by <?php echo $curauth->display_name; ?></h4>
           <p><?php echo $curauth->description; ?></p>
        </div>
    </div>

    I’m not really sure what’s going wrong here but it only displays the HTML (as it should) but without any of the information about the author.

    This is probably something rookie but I can’t see it. I’ve also tried taking the code directly from the Codex but that didn’t work either.

    Cheers,
    Marc

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Display author in category view’ is closed to new replies.