WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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(); ?>

Replace it with this:

        <div class="comments">
            <?php if ( comments_open() ) : ?><br /><p><br /><?php comments_template(); ?><br /></p><br /><?php endif; ?>

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; ?>

I'm not sure how the theme review works 100%, but the theme check plug-in says you passed! Here is a screenshot. You Passed Screenshot Good Luck!

share|improve this answer

I'll try to point you in the right direction, but I'm not 100% sure. I've only been*"Stepping Into Templates"* for a few months (the correct way, not just hacking others themes). I'm sure it is going to be be a conditional statement depending on whether the comments are displayed or not. Since they aren't actually stored on the page, but in their own table of the DB this should be fairly simple. It's a little late tonight/morning, but if this isn't answered by tomorrow I'll try to help you find a solution.

share|improve this answer
thanks for your replies. this is my ticket link.themes.trac.wordpress.org/ticket/4198 – runeveryday Jun 18 '11 at 7:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.