You could change the function to echo like this:
echo apply_filters('the_content', $content);
and then in your template, right before the comments template, place the call to your author box function like this:
author_info_box();
also, you would need to remove the add_action('the_content', 'author_info_box');
Full function example:
function author_info_box() {
global $post;
// Detect if it is a single post with a post author
if ( isset( $post->post_author ) ) {
// Get author's display name
$display_name = get_the_author_meta( 'display_name', $post->post_author );
// Get author's website URL
$user_website = get_the_author_meta('url', $post->post_author);
// Pass all this info to post content
$content="<footer class="author_bio_section" >" . $author_details . '</footer>';
echo apply_filters('the_content', $content);
}
}
Note: apply_filters
iterates through all the functions that are registered to whatever filter is set (in this case, the_content
). Once the last function is done it will return the “filtered” content and thus needing the echo to print it out.