Where to insert get_comments?

I would rarely use ‘echo’ in WordPress template themes because it can cause output to appear before the loops are even executed (aka, at the top of the page).

In this instance, I used the get_comments function within a function that hooked onto the content output:

add_filter('the_content', 'includePosts', 1);

Within the function includePosts, I have set $Comments to appear in the $content variable and I return $content just before adding the filter.

$content is used within the wp core function ‘the_content’ (includes/wp-page-template).

function the_content($more_link_text = null, $stripteaser = 0) {
$content = get_the_content($more_link_text, $stripteaser);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
}