-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcomment.php
52 lines (52 loc) · 2.26 KB
/
comment.php
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
<div class="comments_list">
<ul>
<?php
$comments = $comments_query->comments;
if ($comments) {
?>
<?php
foreach ($comments as $comment) {
?>
<li class="comment">
<div class="row">
<img src="<?php echo get_avatar_url($comment->get_comment_author_email_link) ?>" class="user_avatar">
<strong class="comment_title"><?php echo $comment->comment_author; ?></strong>
</div>
<div class="comment_text">
<span class="comment_date"><?php echo get_comment_date('Y/m/d'); ?></span>
<p><?php echo (nl2br($comment->comment_content)); ?></p>
</div>
<?php
$args = array(
'status' => 'approve',
'number' => '3',
'parent' => $comment->comment_ID
);
$replies = get_comments($args);
foreach ($replies as $reply) {
?>
<ul>
<li class="reply comment">
<div class="row">
<img src="<?php echo get_avatar_url($reply->get_comment_author_email_link) ?>" class="user_avatar">
<strong class="comment_title"><?php echo $reply->comment_author; ?></strong>
</div>
<div class="comment_text">
<span class="comment_date"><?php echo get_comment_date('Y/m/d'); ?></span>
<p><?php echo $reply->comment_content; ?></p>
</div>
</li>
</ul>
<?php } ?>
</li>
<?php
}
?>
</ul>
<div class="row more_comment_row">
<button class="btn btn_sm btn_primary more_comment_btn">نمایش بیشتر
<img src="<?php echo get_template_directory_uri(); ?>/images/bi_arrow-down-circle-fill.png">
</button>
</div>
<?php } ?>
</div>