Forums

[resolved] Author Template - "$curauth" Issues (4 posts)

  1. PieroM
    Member
    Posted 3 years ago #

    I think I've followed the directions on the author template page pretty well, but no matter what version of the "$curath" variable code I use, I can't get the author's name displayed.

    http://www.maniacfan.com/author/flounder/

    The author text is just above where the posts are displayed, but is missing both the Author name and description.

    I am using wp 2.0, and the code I have in the page is as follows:

    <?php
    if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($_GET['author_name']);
    else :
    $curauth = get_userdata($_GET['author']);
    endif;
    ?>

    <center><span class="red"><b>Want to know more about <?php the_author() ?>?</span> Well, here it is, right out of his own pie-hole:</b></center>
    <br>
    <dd><?php echo $curauth->user_description; ?></dd>

    Thanks for your help.

  2. Chris_K
    Administrator
    Posted 3 years ago #

    Why not just use the Author Template Tags

  3. Kafkaesqui
    Moderator
    Posted 3 years ago #

    PieroM, instead of if(isset($_GET['author_name'])) etc. try using this to retrieve the $curauth:

    <?php
    global $wp_query;
    $curauth = $wp_query->get_queried_object();
    ?>

    And keep in mind tags like:

    <?php the_author(); ?>

    are only intended for use inside of The Loop.

  4. Chris_K
    Administrator
    Posted 3 years ago #

    [...] And keep in mind [...]

    Ack. In which case, ignore my reply! Apologies, PieroM.

Topic Closed

This topic has been closed to new replies.

About this Topic