Forums

[resolved] Showing author information on archive by author (3 posts)

  1. pottypotsworth
    Member
    Posted 2 years ago #

    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... http://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

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    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

  3. pottypotsworth
    Member
    Posted 2 years ago #

    Worked perfectly, thanks so much :o)

Topic Closed

This topic has been closed to new replies.

About this Topic