REQUIRED: Comments are displayed as “Off” while they aren’t in wp-admin. Comment form is not displayed in these cases, while it is when a unit test post already has comments.
i have installed the Test data . and on some post and comment test post pages. these pages had some comments. and there is also a Comment form under all the comments. why it notices me,”Comment form is not displayed in these cases, while it is when a unit test post already has comments.”
comments are displayed as “Off” while they aren’t in wp-admin, what’s this meaning? how to correct it?
2 Answers
OK, I figured it out. It took a bit of digging and many bad suggestions. The solution is actually quite simple. Just replace this in your theme files:
Where you have this:
<div class="comments">
<?php comments_template(); ?>
</div>
Replace it with this:
<div class="comments">
<?php if ( comments_open() ) : ?><br /><p><br /><?php comments_template(); ?><br /></p><br /><?php endif; ?>
</div>
Note: I thought this was a little ironic, but if you switch your theme to twenty-eleven (the theme that replaces twentyten in 3.2 Beta) it doesn’t remove comments like they suggest you should.
You can replace the other code that you are using for the comments_popup_link with the similar condition like this:
<div class="comments">
<?php if ( comments_open() ) : ?><br /><p><br /><?php comments_popup_link('0', '1', '%'); ?><br /></p><br /><?php endif; ?>
</div>
I’m not sure how the theme review works 100%, but the theme check plug-in says you passed! Here is a screenshot.
Good Luck!