WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Force template to show post author’s nickname

[Resolved] Force template to show post author’s nickname

  • Hi there,

    I’d like my template to always retrieve the authors nickname, and never their username, regardless of what is set in the users profile.

    I did give the following a try, but I couldn’t make it work:

    single.php
    <?php
    if(isset($_GET[‘author_name’])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;
    ?>

    Post by: <?php echo $curauth->nickname;?>

    Can anyone make a suggestion, or post some tips?
    Thanks,
    Chris

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Force template to show post author’s nickname’ is closed to new replies.