Display Comments Count on Single Posts

Show the number of comments on single posts.

<?php
function display_comments_count() {
    if (is_single()) {
        $comments_count = get_comments_number();
        echo '<p>This post has ' . $comments_count . ' comments.</p>';
    }
}
add_action('wp_footer', 'display_comments_count');

Post Comment