Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
69 lines (56 loc) · 2.06 KB
/
Copy pathcomments.php
File metadata and controls
69 lines (56 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* The template for displaying comments.
*
* Learn more: https://codex.wordpress.org/Template_Hierarchy
*
* @package Forest
*/
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="comments-area">
<?php if ( have_comments() ) : ?>
<?php
global $comments_by_type;
$comments_by_type = separate_comments( $comments );
?>
<?php if ( ! empty( $comments_by_type['comment'] ) ) : // if there are normal comments ?>
<h2 class="comments-title"><?php comments_number( 'No Comments', 'One Comment', '% Comments' ); ?></h2>
<ul class="comment-list">
<?php wp_list_comments( 'type=comment&callback=stag_comments' ); ?>
</ul>
<?php endif; ?>
<?php if ( ! empty( $comments_by_type['pings'] ) ) : // if there are pings ?>
<h2 class="pings-title"><?php comments_number( 'No Comments', 'One Comment', '% Comments' ); ?></h2>
<ul class="ping-list">
<?php wp_list_comments( 'type=pings&callback=stag_list_pings' ); ?>
</ul>
<?php
endif; // end pings
// Are there comments to navigate through?
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
?>
<nav class="navigation comment-navigation" role="navigation">
<h1 class="screen-reader-text section-heading"><?php esc_html_e( 'Comment navigation', 'forest' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'forest' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'forest' ) ); ?></div>
</nav><!-- .comment-navigation -->
<?php endif; // Check for comment navigation ?>
<?php if ( ! comments_open() && get_comments_number() ) : ?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'forest' ); ?></p>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php
comment_form(
array(
'comment_notes_after' => false,
'comment_notes_before' => false,
'logged_in_as' => false,
'title_reply' => __( 'Submit a Comment', 'forest' ),
'label_submit' => __( 'Submit Comment', 'forest' ),
)
);
?>
</div><!-- #comments -->