Make WordPress Themes

source: astra/1.0.2/comments.php

Last change on this file was 76269, checked in by themedropbox, 9 years ago

New version of Astra - 1.0.2

File size: 3.2 KB
Line 
1<?php
2/**
3 * The template for displaying comments.
4 *
5 * This is the template that displays the area of the page that contains both the current comments
6 * and the comment form.
7 *
8 * @link https://codex.wordpress.org/Template_Hierarchy
9 *
10 * @package Astra
11 * @since 1.0.0
12 */
13
14/*
15 * If the current post is protected by a password and
16 * the visitor has not yet entered the password we will
17 * return early without loading the comments.
18 */
19if ( post_password_required() ) {
20        return;
21}
22?>
23
24<div id="comments" class="comments-area">
25       
26        <?php ast_comments_before(); ?>
27
28        <?php // You can start editing here -- including this comment! ?>
29
30        <?php if ( have_comments() ) : ?>
31                <div class="comments-count-wrapper">
32                        <h3 class="comments-title">
33                                <?php
34                                        printf( // WPCS: XSS OK.
35                                                /* translators: 1: number of comments */
36                                                esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'astra' ) ),
37                                        number_format_i18n( get_comments_number() ), get_the_title() );
38                                ?>
39                        </h3>
40                </div>
41
42                <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
43                <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation" aria-label="<?php esc_html_e( 'Comments Navigation', 'astra' ); ?>">
44                        <h3 class="screen-reader-text"><?php ast_default_strings( 'string-comment-navigation-next' ); ?></h3>
45                        <div class="nav-links">
46
47                                <div class="nav-previous"><?php previous_comments_link( ast_default_strings( 'string-comment-navigation-previous', false ) ); ?></div>
48                                <div class="nav-next"><?php next_comments_link( ast_default_strings( 'string-comment-navigation-next', false ) ); ?></div>
49
50                        </div><!-- .nav-links -->
51                </nav><!-- #comment-nav-above -->
52                <?php endif; // Check for comment navigation. ?>
53
54                <ol class="ast-comment-list">
55                        <?php wp_list_comments( array(
56                                'callback' => 'ast_theme_comment',
57                                'style' => 'ol',
58                        ) ); ?>
59                </ol><!-- .ast-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" aria-label="<?php esc_html_e( 'Comments Navigation', 'astra' ); ?>">
63                        <h3 class="screen-reader-text"><?php ast_default_strings( 'string-comment-navigation-next' ); ?></h3>
64                        <div class="nav-links">
65
66                                <div class="nav-previous"><?php previous_comments_link( ast_default_strings( 'string-comment-navigation-previous', false ) ); ?></div>
67                                <div class="nav-next"><?php next_comments_link( ast_default_strings( 'string-comment-navigation-next', false ) ); ?></div>
68
69                        </div><!-- .nav-links -->
70                </nav><!-- #comment-nav-below -->
71                <?php endif; // Check for comment navigation. ?>
72
73        <?php endif; // Check for 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() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
78        ?>
79                <p class="no-comments"><?php ast_default_strings( 'string-comment-closed' ); ?></p>
80        <?php endif; ?>
81
82        <?php comment_form(); ?>
83
84        <?php ast_comments_after(); ?>
85
86</div><!-- #comments -->
Note: See TracBrowser for help on using the repository browser.