• Resolved pottypotsworth

    (@pottypotsworth)


    Hi,

    I an author box at the end of each post with info about the author, standard stuff, name, email, little bio pic. This all works perfectly.

    What i am now trying to achieve is to have this author information at the top of the archive page when users are viewing ‘all posts by author’.

    I am using a conditional tag to check to see if we are on the author archive and this works great, however none of the author information is being displayed, even though i know the tags are correct.

    You can see what i am doing here… https://dev.shout4music.com/author/ash/ the author box at the top doesn’t show any information, now I think this is the case because it isn’t actually pulling the info from the DB until the post loop.

    Could anyone advise me on how i can grab that info before the post loop so the author info can be shown at the top of the page?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Found this in my notes to go in an author template:

    <?php
        if(isset($_GET['author_name'])) :
            $curauth = get_userdatabylogin($author_name);
        else :
            $curauth = get_userdata(intval($author));
        endif;
        ?>
    
        <h2>About: <?php echo $curauth->nickname; ?></h2>
        <dl>
            <dt>Website</dt>
            <dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd>
            <dt>Profile</dt>
            <dd><?php echo $curauth->user_description; ?></dd>
        </dl>
    
        <h2>Posts by <?php echo $curauth->nickname; ?>:</h2>

    Related:
    Author_Templates

    Thread Starter pottypotsworth

    (@pottypotsworth)

    Worked perfectly, thanks so much :o)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Showing author information on archive by author’ is closed to new replies.