Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
68 lines (47 loc) · 1.66 KB
/
Copy pathcomments.php
File metadata and controls
68 lines (47 loc) · 1.66 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
<?php
if ( post_password_required() ) {
return;
}
if ( $comments ) : ?>
<div class="comments" id="comments">
<?php
$comments_number = absint( get_comments_number() );
// Translators: %s = the number of comments
$comments_title = sprintf( _nx( '%s Comment', '%s Comments', $comments_number, 'Translators: %s = the number of comments', 'miyazaki' ), $comments_number ); ?>
<div class="comments-header">
<h3 class="comment-reply-title"><?php echo $comments_title; ?></h3>
<?php if ( comments_open() ) : ?>
<a class="leave-comment-link title-with-arrow" href="#respond">
<span class="text"><?php _e( 'Add Yours', 'miyazaki' ); ?></span>
<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/images/icons/arrow-down.svg" />
</a>
<?php endif; ?>
</div><!-- .comments-header -->
<?php
wp_list_comments( array(
'avatar_size' => 120,
'style' => 'div',
) );
$comment_pagination = paginate_comments_links( array(
'echo' => false,
'prev_text' => __( 'Older Comments', 'miyazaki' ),
'next_text' => __( 'Newer Comments', 'miyazaki' ),
) );
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;
if ( comments_open() || pings_open() ) :
comment_form( 'comment_notes_before=&comment_notes_after=' );
endif;