Making the Comment Count on my site link to the post link or comments area

I recently updated my comments code via this tutorial. I replaced the default comments_popup_link with the following code. This works great in displaying the real comment count (FB comments + WP comments), however, I can’t figure out a way to get the comment count text to link to the post permalink. Any advice?

<span class="comments-link">
<?php 
    $commentCount = full_comment_count();
    if ( $commentCount == 0 ) {
        echo '<post-date>- Leave a comment</post-date>'; 
    } 
    else if ( $commentCount == 1 ) {
        echo '<post-date>- One comment</post-date>';
    }
    else {
        echo '<post-date>- ' . $commentCount . ' comments</post-date>'; 
} 
?>
</span>

Related posts

Leave a Reply

1 comment

  1. I think this way you’ll be able to link to your comments

    <a href="<?php the_permalink(); ?>/#comments">
    
    <span class="comments-link">
    <?php 
        $commentCount = full_comment_count();
        if ( $commentCount == 0 ) {
            echo '<post-date>- Leave a comment</post-date>'; 
        } 
        else if ( $commentCount == 1 ) {
            echo '<post-date>- One comment</post-date>';
        }
        else {
            echo '<post-date>- ' . $commentCount . ' comments</post-date>'; 
    } 
    ?>
    </span>
    </a>