Changeset 25021 for trunk/src/wp-content/themes/twentyfourteen/comments.php
- Timestamp:
- 08/14/2013 04:38:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/comments.php
r24832 r25021 3 3 * The template for displaying Comments. 4 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 twentyfourteen_comment() which is 8 * located in the functions.php file. 5 * The area of the page that contains comments and the comment form. 9 6 * 10 7 * @package WordPress 11 8 * @subpackage Twenty_Fourteen 12 9 */ 10 11 /* 12 * If the current post is protected by a password and the visitor has not yet 13 * entered the password we will return early without loading the comments. 14 */ 15 if ( post_password_required() ) 16 return; 13 17 ?> 14 18 15 <?php 16 /* 17 * If the current post is protected by a password and 18 * the visitor has not yet entered the password we will 19 * return early without loading the comments. 20 */ 21 if ( post_password_required() ) 22 return; 23 ?> 24 25 <div id="comments" class="comments-area"> 26 27 <?php // You can start editing here -- including this comment! ?> 19 <div id="comments" class="comments-area"> 28 20 29 21 <?php if ( have_comments() ) : ?> 30 <h2 class="comments-title">31 <?php32 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyfourteen' ),33 number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );34 ?>35 </h2>36 22 37 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> 38 <nav role="navigation" id="comment-nav-above" class="site-navigation comment-navigation clearfix"> 39 <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> 40 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> 41 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div> 42 </nav><!-- #comment-nav-above .site-navigation .comment-navigation --> 43 <?php endif; // check for comment navigation ?> 23 <h2 class="comments-title"> 24 <?php 25 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyfourteen' ), 26 number_format_i18n( get_comments_number() ), get_the_title() ); 27 ?> 28 </h2> 44 29 45 <ol class="commentlist"> 46 <?php 47 /* Loop through and list the comments. Tell wp_list_comments() 48 * to use twentyfourteen_comment() to format the comments. 49 * If you want to overload this in a child theme then you can 50 * define twentyfourteen_comment() and that will be used instead. 51 * See twentyfourteen_comment() in inc/template-tags.php for more. 52 */ 53 wp_list_comments( array( 'callback' => 'twentyfourteen_comment' ) ); 54 ?> 55 </ol><!-- .commentlist --> 30 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> 31 <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> 32 <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> 33 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> 34 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div> 35 </nav><!-- #comment-nav-above --> 36 <?php endif; // Check for comment navigation. ?> 56 37 57 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> 58 <nav role="navigation" id="comment-nav-below" class="site-navigation comment-navigation clearfix"> 59 <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> 60 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> 61 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div> 62 </nav><!-- #comment-nav-below .site-navigation .comment-navigation --> 63 <?php endif; // check for comment navigation ?> 38 <ol class="comment-list"> 39 <?php 40 wp_list_comments( array( 41 'style' => 'ol', 42 'short_ping' => true, 43 44 // TODO: Remove callback and update styles. 45 'callback'=>'twentyfourteen_comment', 46 ) ); 47 ?> 48 </ol><!-- .comment-list --> 49 50 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> 51 <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> 52 <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> 53 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> 54 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div> 55 </nav><!-- #comment-nav-below --> 56 <?php endif; // Check for comment navigation. ?> 57 58 <?php if ( ! comments_open() ) : ?> 59 <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p> 60 <?php endif; ?> 64 61 65 62 <?php endif; // have_comments() ?> 66 63 67 <?php68 // If comments are closed and there are comments, let's leave a little note, shall we?69 if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :70 ?>71 <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p>72 <?php endif; ?>73 74 64 <?php comment_form(); ?> 75 65 76 </div><!-- #comments .comments-area-->66 </div><!-- #comments -->
Note: See TracChangeset
for help on using the changeset viewer.