[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentyfourteen/ -> comments.php (source)

   1  <?php
   2  /**
   3   * The template for displaying Comments
   4   *
   5   * The area of the page that contains comments and the comment form.
   6   *
   7   * @package WordPress
   8   * @subpackage Twenty_Fourteen
   9   * @since Twenty Fourteen 1.0
  10   */
  11  
  12  /*
  13   * If the current post is protected by a password and the visitor has not yet
  14   * entered the password we will return early without loading the comments.
  15   */
  16  if ( post_password_required() ) {
  17      return;
  18  }
  19  ?>
  20  
  21  <div id="comments" class="comments-area">
  22  
  23      <?php if ( have_comments() ) : ?>
  24  
  25      <h2 class="comments-title">
  26          <?php
  27              $comments_number = get_comments_number();
  28          if ( '1' === $comments_number ) {
  29              /* translators: %s: Post title. */
  30              printf( _x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'twentyfourteen' ), get_the_title() );
  31          } else {
  32              printf(
  33                  /* translators: 1: Number of comments, 2: Post title. */
  34                  _nx(
  35                      '%1$s thought on &ldquo;%2$s&rdquo;',
  36                      '%1$s thoughts on &ldquo;%2$s&rdquo;',
  37                      $comments_number,
  38                      'comments title',
  39                      'twentyfourteen'
  40                  ),
  41                  number_format_i18n( $comments_number ),
  42                  get_the_title()
  43              );
  44          }
  45          ?>
  46      </h2>
  47  
  48          <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
  49      <nav id="comment-nav-above" class="navigation comment-navigation">
  50          <h1 class="screen-reader-text">
  51              <?php
  52              /* translators: Hidden accessibility text. */
  53              _e( 'Comment navigation', 'twentyfourteen' );
  54              ?>
  55          </h1>
  56          <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyfourteen' ) ); ?></div>
  57          <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyfourteen' ) ); ?></div>
  58      </nav><!-- #comment-nav-above -->
  59      <?php endif; // Check for comment navigation. ?>
  60  
  61      <ol class="comment-list">
  62          <?php
  63              wp_list_comments(
  64                  array(
  65                      'style'       => 'ol',
  66                      'short_ping'  => true,
  67                      'avatar_size' => 34,
  68                  )
  69              );
  70          ?>
  71      </ol><!-- .comment-list -->
  72  
  73          <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
  74      <nav id="comment-nav-below" class="navigation comment-navigation">
  75          <h1 class="screen-reader-text">
  76              <?php
  77              /* translators: Hidden accessibility text. */
  78              _e( 'Comment navigation', 'twentyfourteen' );
  79              ?>
  80          </h1>
  81          <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyfourteen' ) ); ?></div>
  82          <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyfourteen' ) ); ?></div>
  83      </nav><!-- #comment-nav-below -->
  84      <?php endif; // Check for comment navigation. ?>
  85  
  86          <?php if ( ! comments_open() ) : ?>
  87      <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p>
  88      <?php endif; ?>
  89  
  90      <?php endif; // have_comments() ?>
  91  
  92      <?php comment_form(); ?>
  93  
  94  </div><!-- #comments -->


Generated : Fri Apr 26 08:20:02 2024 Cross-referenced by PHPXref