Make WordPress Themes

source: lightning/4.1.4/comments.php

Last change on this file was 87921, checked in by themedropbox, 8 years ago

New version of Lightning - 4.1.4

File size: 2.7 KB
Line 
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.
7 *
8 * @package _s
9 */
10
11/*
12 * If the current post is protected by a password and
13 * the visitor has not yet entered the password we will
14 * return early without loading the comments.
15 */
16if ( post_password_required() ) {
17        return;
18}
19?>
20
21<div id="comments" class="comments-area">
22
23        <?php // You can start editing here -- including this comment! ?>
24
25        <?php if ( have_comments() ) : ?>
26                <h2 class="comments-title">
27                        <?php
28                                printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'lightning' ),
29                                        number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
30                        ?>
31                </h2>
32
33                <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
34                <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
35                        <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'lightning' ); ?></h2>
36                        <div class="nav-links">
37
38                                <div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'lightning' ) ); ?></div>
39                                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'lightning' ) ); ?></div>
40
41                        </div><!-- .nav-links -->
42                </nav><!-- #comment-nav-above -->
43                <?php endif; // check for comment navigation ?>
44
45                <ol class="comment-list">
46                        <?php
47                                wp_list_comments( array(
48                                        'style'      => 'ol',
49                                        'short_ping' => true,
50                                ) );
51                        ?>
52                </ol><!-- .comment-list -->
53
54                <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
55                <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
56                        <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'lightning' ); ?></h2>
57                        <div class="nav-links">
58
59                                <div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'lightning' ) ); ?></div>
60                                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'lightning' ) ); ?></div>
61
62                        </div><!-- .nav-links -->
63                </nav><!-- #comment-nav-below -->
64                <?php endif; // check for comment navigation ?>
65
66        <?php endif; // have_comments() ?>
67
68        <?php
69                // If comments are closed and there are comments, let's leave a little note, shall we?
70                if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
71        ?>
72                <?php
73                // Don't display to Page
74                if (is_single()) :?>
75                <p class="no-comments"><?php _e( 'Comments are closed.', 'lightning' ); ?></p>
76                <?php endif; ?>
77        <?php endif; ?>
78
79        <?php comment_form(); ?>
80
81</div><!-- #comments -->
Note: See TracBrowser for help on using the repository browser.