Skip to content
Newer
Older
100644 86 lines (69 sloc) 2.74 KB
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
1 <?php
2 /**
776eaf6 Correcting some irregular capitalisation and coding standards issues
Jack Lenox authored
3 * The template for displaying comments.
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
4 *
de9c988 @PJ-Finlay Updated documentation in comments at the top of files.
PJ-Finlay authored
5 * This is the template that displays the area of the page that contains both the current comments
c780103 There is no more _s_comment() in inc/template-tags.php
Satrya authored
6 * and the comment form.
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
7 *
de9c988 @PJ-Finlay Updated documentation in comments at the top of files.
PJ-Finlay authored
8 * @link https://codex.wordpress.org/Template_Hierarchy
9 *
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
10 * @package _s
11 */
c82269d @mfields _s: Remove password-protected message from comments.php. fixes #1217
mfields authored
12
456cd3d @obenland _s: Removes unnecessary switch in and out of PHP.
obenland authored
13 /*
14 * If the current post is protected by a password and
15 * the visitor has not yet entered the password we will
16 * return early without loading the comments.
17 */
6264437 @philiparthurmoore Add braces around single-line conditionals. See http://make.wordpress…
philiparthurmoore authored
18 if ( post_password_required() ) {
456cd3d @obenland _s: Removes unnecessary switch in and out of PHP.
obenland authored
19 return;
6264437 @philiparthurmoore Add braces around single-line conditionals. See http://make.wordpress…
philiparthurmoore authored
20 }
c82269d @mfields _s: Remove password-protected message from comments.php. fixes #1217
mfields authored
21 ?>
22
1e1fd56 @aahan Removed extra indentation on div#comments
aahan authored
23 <div id="comments" class="comments-area">
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
24
8470f55 @jrfnl Avoid going in and out of PHP unnecessarily.
jrfnl authored
25 <?php
26 // You can start editing here -- including this comment!
27 if ( have_comments() ) : ?>
139dda7 @ianstewart _s: cleaner, more consistent ids and classes for comments.php
ianstewart authored
28 <h2 class="comments-title">
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
29 <?php
1755249 @fklein-lu Fix Codesniffer errors.
fklein-lu authored
30 printf( // WPCS: XSS OK.
062105a @fklein-lu Escape translations on comments.php.
fklein-lu authored
31 esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', '_s' ) ),
ff63379 @philiparthurmoore Better coding standards. See #737.
philiparthurmoore authored
32 number_format_i18n( get_comments_number() ),
33 '<span>' . get_the_title() . '</span>'
34 );
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
35 ?>
36 </h2>
37
1755249 @fklein-lu Fix Codesniffer errors.
fklein-lu authored
38 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
e45aff2 @pixelstrolch Consistent navigation
pixelstrolch authored
39 <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
ff63379 @philiparthurmoore Better coding standards. See #737.
philiparthurmoore authored
40 <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', '_s' ); ?></h2>
e45aff2 @pixelstrolch Consistent navigation
pixelstrolch authored
41 <div class="nav-links">
42
062105a @fklein-lu Escape translations on comments.php.
fklein-lu authored
43 <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', '_s' ) ); ?></div>
44 <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', '_s' ) ); ?></div>
e45aff2 @pixelstrolch Consistent navigation
pixelstrolch authored
45
46 </div><!-- .nav-links -->
b790c82 @JasonHoffmann Comments.php Spelling Issue
JasonHoffmann authored
47 </nav><!-- #comment-nav-above -->
1755249 @fklein-lu Fix Codesniffer errors.
fklein-lu authored
48 <?php endif; // Check for comment navigation. ?>
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
49
d99f4c8 @obenland _s: Adhere to WordPress CSS class naming conventions. See
obenland authored
50 <ol class="comment-list">
4f2b0fa @grappler Add necessary arguments
grappler authored
51 <?php
0b96c02 Undid my multiline function corrections
Jack Lenox authored
52 wp_list_comments( array(
53 'style' => 'ol',
54 'short_ping' => true,
55 ) );
4f2b0fa @grappler Add necessary arguments
grappler authored
56 ?>
c4f2aa3 @obenland _s: Formatting changes:
obenland authored
57 </ol><!-- .comment-list -->
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
58
1755249 @fklein-lu Fix Codesniffer errors.
fklein-lu authored
59 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
e45aff2 @pixelstrolch Consistent navigation
pixelstrolch authored
60 <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
ff63379 @philiparthurmoore Better coding standards. See #737.
philiparthurmoore authored
61 <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', '_s' ); ?></h2>
e45aff2 @pixelstrolch Consistent navigation
pixelstrolch authored
62 <div class="nav-links">
63
062105a @fklein-lu Escape translations on comments.php.
fklein-lu authored
64 <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', '_s' ) ); ?></div>
65 <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', '_s' ) ); ?></div>
e45aff2 @pixelstrolch Consistent navigation
pixelstrolch authored
66
67 </div><!-- .nav-links -->
fa3d869 @obenland _s: Simplify and unify navigation classes throughout Underscores.
obenland authored
68 </nav><!-- #comment-nav-below -->
8470f55 @jrfnl Avoid going in and out of PHP unnecessarily.
jrfnl authored
69 <?php
70 endif; // Check for comment navigation.
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
71
8470f55 @jrfnl Avoid going in and out of PHP unnecessarily.
jrfnl authored
72 endif; // Check for have_comments().
73
74
75 // If comments are closed and there are comments, let's leave a little note, shall we?
76 if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
77
ff63379 @philiparthurmoore Better coding standards. See #737.
philiparthurmoore authored
78 <p class="no-comments"><?php esc_html_e( 'Comments are closed.', '_s' ); ?></p>
8470f55 @jrfnl Avoid going in and out of PHP unnecessarily.
jrfnl authored
79 <?php
80 endif;
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
81
8470f55 @jrfnl Avoid going in and out of PHP unnecessarily.
jrfnl authored
82 comment_form();
83 ?>
edfeccc @ianstewart _s: initial fork of Toolbox
ianstewart authored
84
c4f2aa3 @obenland _s: Formatting changes:
obenland authored
85 </div><!-- #comments -->
Something went wrong with that request. Please try again.