On my single.php and index.php I’m including the comment entry routine with this code…
<?php if(get_option('allow_comments_posts')){comments_template();} ?>
However, when the specific post being viewed in single.php has “Allow Comments” unchecked, I don’t want the comment template to appear.
I was under the impression that the comments_template() routine automatically managed this, but apparently I need to wrap it or pass a paramater?
As far as I remember main purpose of
comments_template()
is to load template and specific logic should be handled inside that template.Snippet from Twenty Ten
comments.php
: