Drupal 7 Comment Number

I wonder if this is fixed in 8 or 9?

To get the number of comments rendered on your node, you can add this to the template (e.g., node.tpl.php) for your theme.

echo "<a href='".$node_url."#comments'>";
 print $node->comment_count; 
    if($node->comment_count==1) { 
        echo " comment ";} 
    else echo " comments ";
echo "</a>";

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.