wp/wp-content/themes/twentythirteen/comments.php
author ymh <ymh.work@gmail.com>
Tue, 09 Jun 2015 03:35:32 +0200
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
permissions -rw-r--r--
upgrade wordpress + plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * The template for displaying Comments
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * The area of the page that contains comments and the comment form.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * @subpackage Twenty_Thirteen
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 * @since Twenty Thirteen 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
/*
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
 * If the current post is protected by a password and the visitor has not yet
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
 * entered the password we will return early without loading the comments.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
if ( post_password_required() )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
	return;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
<div id="comments" class="comments-area">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
	<?php if ( have_comments() ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
		<h2 class="comments-title">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
				printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentythirteen' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
					number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
		</h2>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
		<ol class="comment-list">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
				wp_list_comments( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
					'style'       => 'ol',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
					'short_ping'  => true,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
					'avatar_size' => 74,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
				) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
		</ol><!-- .comment-list -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
		<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
			// Are there comments to navigate through?
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
			if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
		<nav class="navigation comment-navigation" role="navigation">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
			<h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
			<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentythirteen' ) ); ?></div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
			<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentythirteen' ) ); ?></div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
		</nav><!-- .comment-navigation -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
		<?php endif; // Check for comment navigation ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
		<?php if ( ! comments_open() && get_comments_number() ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
		<p class="no-comments"><?php _e( 'Comments are closed.' , 'twentythirteen' ); ?></p>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
		<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
	<?php endif; // have_comments() ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
	<?php comment_form(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
</div><!-- #comments -->