Make WordPress Themes

source: bizberg/0.6/comments.php

Last change on this file was 113528, checked in by themedropbox, 6 years ago

New version of Bizberg - 0.6

File size: 1.8 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 Bizberg
11 */
12
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 */
18if ( post_password_required() ) {
19        return;
20}
21?>
22
23<div id="comments" class="comments-area">
24
25        <?php
26        // You can start editing here -- including this comment!
27        if ( have_comments() ) : ?>
28                <h2 class="comments-title">
29                        <?php
30                        $bizberg_comment_count = get_comments_number();
31                        if ( 1 === $bizberg_comment_count ) {
32                                printf(
33                                        /* translators: 1: title. */
34                                        esc_html_e( 'One thought on &ldquo;%1$s&rdquo;', 'bizberg' ),
35                                        '<span>' . esc_html( get_the_title() ) . '</span>'
36                                );
37                        } else {
38                                printf( // WPCS: XSS OK.
39                                        /* translators: 1: comment count number, 2: title. */
40                                        esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $bizberg_comment_count, 'comments title', 'bizberg' ) ),
41                                        esc_attr( number_format_i18n( $bizberg_comment_count ) ),
42                                        '<span>' . esc_html( get_the_title() ) . '</span>'
43                                );
44                        }
45                        ?>
46                </h2><!-- .comments-title -->
47
48                <?php the_comments_navigation(); ?>
49
50                <ol class="comment-list">
51                        <?php
52                                wp_list_comments( array(
53                                        'walker' => new Bizberg_Comment_Walker()
54                                ) );
55                        ?>
56                </ol><!-- .comment-list -->
57
58
59                <?php the_comments_navigation();
60
61                // If comments are closed and there are comments, let's leave a little note, shall we?
62                if ( ! comments_open() ) : ?>
63                        <p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'bizberg' ); ?></p>
64                <?php
65                endif;
66
67        endif; // Check for have_comments().
68
69        comment_form();
70        ?>
71
72</div><!-- #comments -->
Note: See TracBrowser for help on using the repository browser.