Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
70 lines (62 loc) · 2.43 KB
/
Copy pathcomments.php
File metadata and controls
70 lines (62 loc) · 2.43 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
<?php
// Do not delete these lines
if ( !empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) )
die ( 'Please do not load this page directly. Thanks!' );
if ( post_password_required() ) {
?> <p><?php _e( 'This post is password protected. Enter the password to view comments.', 'base' ); ?></p> <?php
return;
}
function theme_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment; ?>
<div class="commentlist-item">
<div <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<div class="avatar-holder"><?php echo get_avatar( $comment, 48 ); ?></div>
<div class="commentlist-holder">
<?php edit_comment_link( __( '(Edit)', 'base' ), '<p class="edit-link">', '</p>' ); ?>
<p class="meta"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php comment_date( 'F d, Y' ); ?> <?php _e( 'at', 'base' ); ?> <?php comment_time( 'g:i a' ); ?></a>, <?php comment_author_link(); ?> <?php _e( 'said:', 'base' ); ?></p>
<?php if ( $comment->comment_approved == '0' ) : ?>
<p><?php _e( 'Your comment is awaiting moderation.', 'base' ); ?></p>
<?php else : ?>
<?php comment_text(); ?>
<?php endif; ?>
<?php
comment_reply_link( array_merge( $args, array(
'reply_text' => __( 'Reply', 'base' ),
'before' => '<p>',
'after' => '</p>',
'depth' => $depth,
'max_depth' => $args['max_depth'],
) ) ); ?>
</div>
</div>
<?php }
function theme_comment_end() { ?>
</div>
<?php }
?>
<?php if ( have_comments() ) : ?>
<div class="section comments" id="comments">
<h2><?php comments_number( __('No Responses', 'base' ), __( 'One Response', 'base' ), __( '% Responses', 'base' ) );?> <?php _e( 'to', 'base' ); ?> “<?php the_title(); ?>”</h2>
<div class="commentlist">
<?php wp_list_comments( array(
'callback' => 'theme_comment',
'end-callback' => 'theme_comment_end',
'style' => 'div',
) ); ?>
</div>
<?php if( $comments_links = paginate_comments_links( array( 'echo' => false ) ) ): ?>
<div class="navigation-comments">
<?php echo $comments_links; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<div class="section respond">
<?php comment_form(); ?>
</div>
<?php else : ?>
<?php if ( is_singular( array( 'post' ) ) ) : ?>
<p><?php _e( 'Comments are closed.', 'base' ); ?></p>
<?php endif; ?>
<?php endif; ?>