the_author function is displaying wrong name and url

Sorry, but I found the answer very quickly myself and I attempted to delete this original question, but I think maybe somebody else may need this answer.

This is right code to solve this issue:

<h1 class="page-title">  <?php echo '<a href="'.get_author_posts_url(get_userdata($posts[0]->post_author)->data->ID).'">'.get_userdata($posts[0]->post_author)->data->display_name.'</a>'; ?></h1>