[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentythirteen/ -> 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_Thirteen
   9   * @since Twenty Thirteen 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          <h2 class="comments-title">
  25              <?php
  26              if ( 1 === get_comments_number() ) {
  27                  printf(
  28                      /* translators: %s: The post title. */
  29                      _x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'twentythirteen' ),
  30                      '<span>' . get_the_title() . '</span>'
  31                  );
  32              } else {
  33                  printf(
  34                      /* translators: 1: The number of comments, 2: The post title. */
  35                      _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentythirteen' ),
  36                      number_format_i18n( get_comments_number() ),
  37                      '<span>' . get_the_title() . '</span>'
  38                  );
  39              }
  40              ?>
  41          </h2>
  42  
  43          <ol class="comment-list">
  44              <?php
  45                  wp_list_comments(
  46                      array(
  47                          'style'       => 'ol',
  48                          'short_ping'  => true,
  49                          'avatar_size' => 74,
  50                      )
  51                  );
  52              ?>
  53          </ol><!-- .comment-list -->
  54  
  55          <?php
  56              // Are there comments to navigate through?
  57          if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
  58              ?>
  59          <nav class="navigation comment-navigation">
  60          <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1>
  61          <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentythirteen' ) ); ?></div>
  62          <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentythirteen' ) ); ?></div>
  63          </nav><!-- .comment-navigation -->
  64          <?php endif; // Check for comment navigation. ?>
  65  
  66          <?php if ( ! comments_open() && get_comments_number() ) : ?>
  67          <p class="no-comments"><?php _e( 'Comments are closed.', 'twentythirteen' ); ?></p>
  68          <?php endif; ?>
  69  
  70      <?php endif; // have_comments() ?>
  71  
  72      <?php comment_form(); ?>
  73  
  74  </div><!-- #comments -->


Generated: Sun Dec 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1