Can’t grab author info outside of the loop

I have an author box outside of the loop that is supposed to grab the name of the author, but the correct author isn’t being displayed most likely because these tags only work inside the loop. What can I change in this code to make it work outside of the loop?

    <div id="author-bio">
        <div class="inner">
            <h3>About <?php echo get_the_author(); ?></h3>
            <?php echo get_avatar( get_the_author_meta( 'user_email' ), 70 ); ?>
            <div class="author-info">
                <p><?php the_author_meta( 'description' ); ?></p>
                <p><a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">View all posts by <?php echo get_the_author(); ?> <span class="meta-nav">&rarr;</span></a></p>
            </div>
        </div>
    </div>

Read more here: Can’t grab author info outside of the loop

Leave a Reply

Your email address will not be published. Required fields are marked *