Make WordPress Themes

source: lightning/12.9.0/comments.php

Last change on this file was 138180, checked in by themedropbox, 5 years ago

New version of Lightning - 12.9.0

File size: 2.9 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<?php if ( post_type_supports( get_post_type(), 'comments' ) ) : ?>
21
22        <?php 
23        global $post;
24        if ( comments_open( $post->ID ) || have_comments() ) : ?>
25        <div id="comments" class="comments-area">
26        <?php endif; ?>
27
28                <?php // You can start editing here -- including this comment! ?>
29
30                <?php if ( have_comments() ) : ?>
31                        <h2 class="comments-title">
32                                <?php
33                                        printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'lightning' ),
34                                                number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
35                                ?>
36                        </h2>
37
38                        <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
39                                <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
40                                        <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'lightning' ); ?></h2>
41                                        <div class="nav-links">
42
43                                                <div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'lightning' ) ); ?></div>
44                                                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'lightning' ) ); ?></div>
45
46                                        </div><!-- .nav-links -->
47                                </nav><!-- #comment-nav-above -->
48                        <?php endif; // check for comment navigation ?>
49
50                        <ol class="comment-list">
51                                <?php
52                                        wp_list_comments(
53                                                array(
54                                                        'style'      => 'ol',
55                                                        'short_ping' => true,
56                                                )
57                                        );
58                                ?>
59                        </ol><!-- .comment-list -->
60
61                        <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
62                                <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
63                                        <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'lightning' ); ?></h2>
64                                        <div class="nav-links">
65
66                                                <div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'lightning' ) ); ?></div>
67                                                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'lightning' ) ); ?></div>
68
69                                        </div><!-- .nav-links -->
70                                </nav><!-- #comment-nav-below -->
71                        <?php endif; // check for comment navigation ?>
72
73                <?php endif; // have_comments() ?>
74
75                <?php
76                // If comments are closed and there are comments, let's leave a little note, shall we?
77                if ( ! comments_open() && '0' != get_comments_number() ) :
78                ?>
79                        <p class="no-comments"><?php _e( 'Comments are closed.', 'lightning' ); ?></p>
80
81                <?php endif; ?>
82
83                <?php comment_form(); ?>
84
85        <?php if ( comments_open( $post->ID ) || have_comments() ) : ?>
86        </div><!-- #comments -->
87        <?php endif; ?>
88
89<?php endif; ?>
Note: See TracBrowser for help on using the repository browser.