Ticket #20469: better-comments-notice-20492.diff

File better-comments-notice-20492.diff, 1.2 KB (added by iandstewart, 13 months ago)
  • wp-content/themes/twentyeleven/comments.php

     
    6363                </nav> 
    6464                <?php endif; // check for comment navigation ?> 
    6565 
     66        <?php endif; // have_comments() ?> 
     67         
    6668        <?php 
    67                 /* If there are no comments and comments are closed, let's leave a little note, shall we? 
    68                  * But we don't want the note on pages or post types that do not support comments. 
    69                  */ 
    70                 elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : 
     69        /* If there are no comments and comments are closed, let's leave a little note, shall we? 
     70         * But we only want the note on posts and pages that had comments in the first place. 
     71         * It's just the polite thing to do! 
     72         */ 
     73        if ( ! comments_open() && '0' != get_comments_number() ) : 
    7174        ?> 
    72                 <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p> 
     75                <!-- If comments are closed. --> 
     76                <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyeleven' ) ?></p> 
    7377        <?php endif; ?> 
    7478 
    7579        <?php comment_form(); ?>