| [ Index ] |
PHP Cross Reference of WordPress |
[Summary view] [Print] [Text view]
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 twentytwelve_comment() which is 8 * located in the functions.php file. 9 * 10 * @package WordPress 11 * @subpackage Twenty_Twelve 12 * @since Twenty Twelve 1.0 13 */ 14 ?> 15 <div id="comments"> 16 <?php if ( post_password_required() ) : ?> 17 <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentytwelve' ); ?></p> 18 </div><!-- #comments --> 19 <?php 20 /* Stop the rest of comments.php from being processed, 21 * but don't kill the script entirely -- we still have 22 * to fully load the template. 23 */ 24 return; 25 endif; 26 ?> 27 28 <?php // You can start editing here -- including this comment! ?> 29 30 <?php if ( have_comments() ) : ?> 31 <h2 id="comments-title"> 32 <?php 33 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentytwelve' ), 34 number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); 35 ?> 36 </h2> 37 38 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> 39 <nav id="comment-nav-above" role="navigation"> 40 <h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1> 41 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentytwelve' ) ); ?></div> 42 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentytwelve' ) ); ?></div> 43 </nav> 44 <?php endif; // check for comment navigation ?> 45 46 <ol class="commentlist"> 47 <?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?> 48 </ol><!-- .commentlist --> 49 50 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> 51 <nav id="comment-nav-below" role="navigation"> 52 <h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1> 53 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentytwelve' ) ); ?></div> 54 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentytwelve' ) ); ?></div> 55 </nav> 56 <?php endif; // check for comment navigation ?> 57 58 <?php // If there are no comments and comments are closed, let's leave a note. 59 elseif ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : 60 ?> 61 <p class="nocomments"><?php _e( 'Comments are closed.', 'twentytwelve' ); ?></p> 62 <?php endif; ?> 63 64 <?php comment_form(); ?> 65 66 </div><!-- #comments -->
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Tue Mar 20 03:55:56 2012 | Hosted by follow the white rabbit. |