|
1 |
| -<?php |
2 |
| -/** |
3 |
| - * The template for displaying Comments. |
4 |
| - * |
5 |
| - * The area of the page that contains both current comments |
6 |
| - * and the comment form. The actual display of comments is |
7 |
| - * handled by a callback to twentyeleven_comment() which is |
8 |
| - * located in the functions.php file. |
9 |
| - */ |
10 |
| -?> |
11 |
| - <div id="comments"> |
12 |
| - <?php if ( post_password_required() ) : ?> |
13 |
| - <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p> |
14 |
| - </div><!-- #comments --> |
15 |
| - <?php |
16 |
| - /* Stop the rest of comments.php from being processed, |
17 |
| - * but don't kill the script entirely -- we still have |
18 |
| - * to fully load the template. |
19 |
| - */ |
20 |
| - return; |
21 |
| - endif; |
22 |
| - ?> |
23 |
| - |
24 |
| - <?php // You can start editing here -- including this comment! ?> |
25 |
| - |
26 |
| - <?php if ( have_comments() ) : ?> |
27 |
| - <h2 id="comments-title"> |
28 |
| - <?php |
29 |
| - printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyeleven' ), |
30 |
| - number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); |
31 |
| - ?> |
32 |
| - </h2> |
33 |
| - |
34 |
| - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
35 |
| - <nav id="comment-nav-above"> |
36 |
| - <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1> |
37 |
| - <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div> |
38 |
| - <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div> |
39 |
| - </nav> |
40 |
| - <?php endif; // check for comment navigation ?> |
41 |
| - |
42 |
| - <ol class="commentlist"> |
43 |
| - <?php |
44 |
| - /* Loop through and list the comments. Tell wp_list_comments() |
45 |
| - * to use twentyeleven_comment() to format the comments. |
46 |
| - * If you want to overload this in a child theme then you can |
47 |
| - * define twentyeleven_comment() and that will be used instead. |
48 |
| - * See twentyeleven_comment() in twentyeleven/functions.php for more. |
49 |
| - */ |
50 |
| - wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) ); |
51 |
| - ?> |
52 |
| - </ol> |
53 |
| - |
54 |
| - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
55 |
| - <nav id="comment-nav-below"> |
56 |
| - <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1> |
57 |
| - <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div> |
58 |
| - <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div> |
59 |
| - </nav> |
60 |
| - <?php endif; // check for comment navigation ?> |
61 |
| - |
62 |
| - <?php |
63 |
| - /* If there are no comments and comments are closed, let's leave a little note, shall we? |
64 |
| - * But we don't want the note on pages or post types that do not support comments. |
65 |
| - */ |
66 |
| - elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : |
67 |
| - ?> |
68 |
| - <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p> |
69 |
| - <?php endif; ?> |
70 |
| - |
71 |
| - <?php comment_form(); ?> |
72 |
| - |
73 |
| -</div><!-- #comments --> |
| 1 | +<div id="comments"> |
| 2 | + <?php if ( have_comments() ) : ?> |
| 3 | + <h2 id="comments-title"> |
| 4 | + <?php |
| 5 | + printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyeleven' ), |
| 6 | + number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); |
| 7 | + ?> |
| 8 | + </h2> |
| 9 | + |
| 10 | + <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> |
| 11 | + <nav id="comment-nav-above"> |
| 12 | + <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1> |
| 13 | + <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div> |
| 14 | + <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div> |
| 15 | + </nav> |
| 16 | + <?php endif; ?> |
| 17 | + |
| 18 | + <ol class="commentlist"> |
| 19 | + <?php wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) ); ?> |
| 20 | + </ol> |
| 21 | + |
| 22 | + <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> |
| 23 | + <nav id="comment-nav-below"> |
| 24 | + <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1> |
| 25 | + <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div> |
| 26 | + <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div> |
| 27 | + </nav> |
| 28 | + <?php endif; // check for comment navigation ?> |
| 29 | + |
| 30 | + <?php |
| 31 | + /* If there are no comments and comments are closed, let's leave a little note, shall we? |
| 32 | + * But we don't want the note on pages or post types that do not support comments. |
| 33 | + */ |
| 34 | + elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : |
| 35 | + ?> |
| 36 | + <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p> |
| 37 | + <?php endif; ?> |
| 38 | + |
| 39 | + <?php comment_form(); ?> |
| 40 | +</div> |
0 commit comments