Make WordPress Themes

source: astra/3.6.4/comments.php

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

New version of Astra - 3.3.0

File size: 3.4 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
14if ( ! defined( 'ABSPATH' ) ) {
15        exit; // Exit if accessed directly.
16}
17
18/*
19 * If the current post is protected by a password and
20 * the visitor has not yet entered the password we will
21 * return early without loading the comments.
22 */
23if ( post_password_required() ) {
24        return;
25}
26?>
27
28<div id="comments" class="comments-area">
29
30        <?php astra_comments_before(); ?>
31
32        <?php 
33        if ( have_comments() ) : 
34                astra_markup_open( 'comment-count-wrapper' ); 
35                ?>
36                        <h3 class="comments-title">
37                                <?php
38                                $comments_title = apply_filters(
39                                        'astra_comment_form_title',
40                                        sprintf( // WPCS: XSS OK.
41                                                /* translators: 1: number of comments */
42                                                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' ) ),
43                                                number_format_i18n( get_comments_number() ),
44                                                get_the_title()
45                                        )
46                                );
47
48                                echo esc_html( $comments_title );
49                                ?>
50                        </h3>
51                <?php 
52                astra_markup_close( 'comment-count-wrapper' );
53                if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : 
54                        ?>
55                <nav id="comment-nav-above" class="navigation comment-navigation" aria-label="<?php esc_attr_e( 'Comments Navigation', 'astra' ); ?>">
56                        <h3 class="screen-reader-text"><?php echo esc_html( astra_default_strings( 'string-comment-navigation-next', false ) ); ?></h3>
57                        <div class="nav-links">
58
59                                <div class="nav-previous"><?php previous_comments_link( astra_default_strings( 'string-comment-navigation-previous', false ) ); ?></div>
60                                <div class="nav-next"><?php next_comments_link( astra_default_strings( 'string-comment-navigation-next', false ) ); ?></div>
61
62                        </div><!-- .nav-links -->
63                </nav><!-- #comment-nav-above -->
64                <?php endif; ?>
65
66                <ol class="ast-comment-list">
67                        <?php
68                        wp_list_comments(
69                                array(
70                                        'callback' => 'astra_theme_comment',
71                                        'style'    => 'ol',
72                                )
73                        );
74                        ?>
75                </ol><!-- .ast-comment-list -->
76
77                <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
78                <nav id="comment-nav-below" class="navigation comment-navigation" aria-label="<?php esc_attr_e( 'Comments Navigation', 'astra' ); ?>">
79                        <h3 class="screen-reader-text"><?php echo esc_html( astra_default_strings( 'string-comment-navigation-next', false ) ); ?></h3>
80                        <div class="nav-links">
81
82                                <div class="nav-previous"><?php previous_comments_link( astra_default_strings( 'string-comment-navigation-previous', false ) ); ?></div>
83                                <div class="nav-next"><?php next_comments_link( astra_default_strings( 'string-comment-navigation-next', false ) ); ?></div>
84
85                        </div><!-- .nav-links -->
86                </nav><!-- #comment-nav-below -->
87                <?php endif; ?>
88
89        <?php endif; ?>
90
91        <?php
92                // If comments are closed and there are comments, let's leave a little note, shall we?
93        if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
94                ?>
95                <p class="no-comments"><?php echo esc_html( astra_default_strings( 'string-comment-closed', false ) ); ?></p>
96        <?php endif; ?>
97
98        <?php comment_form(); ?>
99
100        <?php astra_comments_after(); ?>
101
102</div><!-- #comments -->
Note: See TracBrowser for help on using the repository browser.