WordPress.org

Make WordPress Core

Ticket #20469: 20469.3.diff

File 20469.3.diff, 1.1 KB (added by obenland, 17 months ago)
  • wp-content/themes/twentyeleven/comments.php

     
    6363                </nav> 
    6464                <?php endif; // check for comment navigation ?> 
    6565 
    66         <?php 
     66                <?php 
    6767                /* 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. 
     68                 * But we only want the note on posts and pages that had comments in the first place. 
     69                 * It's just the polite thing to do! 
    6970                 */ 
    70                 elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : 
    71         ?> 
    72                 <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p> 
    73         <?php endif; ?> 
     71                if ( ! comments_open() && ! empty( $comments_by_type['comment'] ) ) : ?> 
     72                <!-- If comments are closed. --> 
     73                <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyeleven' ); ?></p> 
     74                <?php endif; ?> 
     75 
     76        <?php endif; // have_comments() ?> 
    7477 
    7578        <?php comment_form(); ?> 
    7679