-
Notifications
You must be signed in to change notification settings - Fork 0
/
obituary-commentWalker.php
64 lines (52 loc) · 2.55 KB
/
obituary-commentWalker.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
53
54
55
56
57
58
59
60
61
62
63
64
<?php
class Obituary_Walker_Comment extends Walker_Comment {
protected function html5_comment( $comment, $depth, $args ) {
$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
?>
<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '' ); ?>>
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
<div class="comment-content">
<?php $candle = get_comment_meta( get_comment_ID(), 'candle', true ) ?>
<?php
if( $candle ) { ?>
<div class="candle-img">
<img src="<?= get_stylesheet_directory_uri() . '/images/candles/' . $candle . '.png'; ?>" width="70" height="70" alt="A lit Candle">
</div>
<?php
}
?>
<div class="comment-author vcard">
<?php printf( __( '%s' ), sprintf( '<h3 class="fn">%s</h3>', get_comment_author() ) ); ?>
</div><!-- .comment-author -->
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></p>
<?php endif; ?>
<div class="comment-text">
<?php comment_text(); ?>
</div>
<div class="comment-metadata">
<div class="reply one-half first">
<?php
comment_reply_link( array_merge( $args, array(
'reply_text' => __( 'Report as abuse' ),
'add_below' => 'div-comment',
'depth' => $depth,
'max_depth' => $args['max_depth'],
'before' => '',
'after' => ''
) ) );
?>
</div>
<div class="date one-half">
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID, $args ) ); ?>">
<time datetime="<?php comment_time( 'c' ); ?>">
<?php printf( _x( '%1$s', 'translations' ), get_comment_date('d/m/Y') ); ?>
</time>
</a>
</div>
</div><!-- .comment-metadata -->
</div><!-- .comment-content -->
</article><!-- .comment-body -->
<?php
}
}