Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
161 lines (153 loc) · 4.49 KB
/
Copy pathcomments.php
File metadata and controls
161 lines (153 loc) · 4.49 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
/**
* The template for displaying comments.
*
* The area of the page that contains both current comments
* and the comment form.
*
* @package Memberlite
*/
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="comments-area">
<?php if ( have_comments() ) : ?>
<?php
$memberlite_comments = get_comments(
array(
'type' => 'comment',
'post_id' => $post->ID,
'status' => 'approve',
)
);
$memberlite_trackbacks = get_comments(
array(
'type' => 'trackback',
'post_id' => $post->ID,
'status' => 'approve',
)
);
$memberlite_pingbacks = get_comments(
array(
'type' => 'pingback',
'post_id' => $post->ID,
'status' => 'approve',
)
);
?>
<?php
if ( count( $memberlite_trackbacks ) == 0 && count( $memberlite_pingbacks ) == 0 ) { ?>
<h2>
<?php
/* translators: %s: number of comments */
printf( esc_html__( 'Comments (%s)', 'memberlite' ), count( $memberlite_comments ) );
?>
</h2>
<?php the_comments_navigation(); ?>
<?php
wp_list_comments(
array(
'avatar_size' => 40,
'per_page' => 0,
'type' => 'comment',
'style' => 'div',
)
);
?>
<?php the_comments_navigation(); ?>
<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) { ?>
<p class="pmpro_message pmpro_alert no-comments"><?php esc_html_e( 'Comments are closed.', 'memberlite' ); ?></p>
<?php }
} else { ?>
<div class="memberlite_tabbable">
<ul class="memberlite_tabs">
<?php if ( count( $memberlite_comments ) > 0 ) { ?>
<li class="memberlite_active"><a href="#tab-comments" data-toggle="tab">
<?php
/* translators: %s: number of comments */
printf( esc_html__( 'Comments (%s)', 'memberlite' ), count( $memberlite_comments ) );
?>
</a></li>
<?php } ?>
<?php if ( count( $memberlite_trackbacks ) > 0 ) { ?>
<li><a href="#tab-tracks" data-toggle="tab">
<?php
/* translators: %s: number of trackbacks */
printf( esc_html__( 'Trackbacks (%s)', 'memberlite' ), count( $memberlite_trackbacks ) );
?>
</a></li>
<?php } ?>
<?php if ( count( $memberlite_pingbacks ) > 0 ) { ?>
<li><a href="#tab-pings" data-toggle="tab">
<?php
/* translators: number of pingbacks */
printf( esc_html__( 'Pingbacks (%s)', 'memberlite' ), count( $memberlite_pingbacks ) );
?>
</a></li>
<?php } ?>
</ul>
<div class="memberlite_tab_content">
<?php if ( count( $memberlite_comments ) > 0 ) { ?>
<div class="memberlite_tab_pane memberlite_active" id="tab-comments">
<?php the_comments_navigation(); ?>
<?php
wp_list_comments(
array(
'avatar_size' => 40,
'per_page' => 0,
'type' => 'comment',
'style' => 'div',
)
);
?>
<?php the_comments_navigation(); ?>
<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="pmpro_message pmpro_alert no-comments"><?php esc_html_e( 'Comments are closed.', 'memberlite' ); ?></p>
<?php endif; ?>
</div>
<?php } ?>
<?php if ( count( $memberlite_trackbacks ) > 0 ) { ?>
<div class="memberlite_tab_pane" id="tab-tracks">
<?php
wp_list_comments(
array(
'max_depth' => 1,
'type' => 'trackback',
'short_ping' => false,
'style' => 'div',
)
);
?>
</div>
<?php } ?>
<?php if ( count( $memberlite_pingbacks ) > 0 ) { ?>
<div class="memberlite_tab_pane" id="tab-pings">
<?php
wp_list_comments(
array(
'max_depth' => 1,
'type' => 'pingback',
'short_ping' => false,
'style' => 'div',
)
);
?>
</div>
<?php } ?>
</div>
</div>
<?php } // End if(). ?>
<?php endif; ?>
<?php comment_form(); ?>
</div><!-- #comments -->