-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcomments.php
More file actions
76 lines (49 loc) · 1.68 KB
/
Copy pathcomments.php
File metadata and controls
76 lines (49 loc) · 1.68 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
70
71
72
73
74
75
76
<?php
if ( post_password_required() ) {
return;
}
$comments_number = absint( get_comments_number() );
if ( $comments_number ) :
// Translators: %s = the number of comments
$comments_title = sprintf( _nx( '%s Comment', '%s Comments', $comments_number, 'Translators: %s = the number of comments', 'koji' ), $comments_number ); ?>
<div class="comments" id="comments">
<div class="comments-header">
<h3 class="comment-reply-title"><?php echo $comments_title; ?></h3>
<?php if ( comments_open() ) : ?>
<a class="leave-comment-link" href="#respond"><?php _e( 'Add Yours →', 'koji' ); ?></a>
<?php endif; ?>
</div><!-- .comments-header -->
<?php
wp_list_comments( array(
'avatar_size' => 120,
'style' => 'div',
) );
$comment_pagination = paginate_comments_links( array(
'echo' => false,
) );
if ( $comment_pagination ) :
// If we're only showing the "Next" link, add a class indicating so
if ( strpos( $comment_pagination, 'prev page-numbers' ) === false ) {
$pagination_classes = ' only-next';
} else {
$pagination_classes = '';
}
?>
<nav class="comments-pagination pagination<?php echo $pagination_classes; ?>">
<?php echo $comment_pagination; ?>
</nav>
<?php endif; ?>
</div><!-- comments -->
<?php endif; ?>
<?php if ( comments_open() || pings_open() ) :
comment_form( array(
'comments_notes_before' => '',
'comments_notes_after' => '',
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h2>',
) );
else : ?>
<div class="comment-respond" id="respond">
<p class="closed"><?php _e( 'Comments are closed.', 'koji' ); ?></p>
</div><!-- #respond -->
<?php endif; ?>