File: /home/dh_5jabqq/bermudashipwreckarchive.com/wp-content/themes/loquet/comments.php
<?php
/*
* The template for displaying comments area
*/
if( post_password_required() ) {
return;
}
function loquet_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
extract( $args, EXTR_SKIP );
$author_control = get_comment_author();
echo '<li ' . comment_class( empty( $args['has_children'] ) ? 'gt-item' : 'gt-item gt-parent', get_comment_ID(), get_the_ID(), false ) . ' id="comment-' . get_comment_ID() . '">';
echo '<div class="gt-top">';
if( get_avatar( $comment ) ) {
echo '<div class="gt-avatar">';
echo get_avatar( $comment, $args['avatar_size'] );
echo '</div>';
}
echo '<div class="gt-details">';
if( !empty( $author_control ) ) {
echo '<div class="gt-author">';
echo get_comment_author();
echo '</div>';
}
echo '<div class="gt-time">';
printf( esc_html__( '%1$s', 'loquet' ), get_comment_date(), get_comment_time() );
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="gt-bottom">';
echo '<div class="gt-comment-text">';
comment_text();
echo '</div>';
if( $comment->comment_approved == '0' ) {
echo '<div class="gt-comment-text gt-moderation-text">';
echo wpautop( esc_html__( 'Your comment is awaiting moderation.', 'loquet' ) );
echo '</div>';
}
echo '<div class="gt-buttons">';
comment_reply_link( array_merge( $args, array( 'add_below' => 'comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '', 'after' => '' ) ) );
edit_comment_link( esc_html__( 'Edit', 'loquet' ), '', '' );
echo '</div>';
echo '</div>';
}
echo '<div id="comments" class="gt-comments gt-style-1">';
if( have_comments() ) {
echo '<ul class="gt-accordion" data-accordion data-allow-all-closed="true">';
echo '<li class="accordion-item is-active" data-accordion-item>';
echo '<a href="#">';
echo '<div class="gt-comment-title">';
echo '<div>';
echo '<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M22 3v13h-11.643l-4.357 3.105v-3.105h-4v-13h20zm2-2h-24v16.981h4v5.019l7-5.019h13v-16.981z"/></svg>';
echo '<span>';
printf( _nx( '1 Comment', '%1$s Comments', get_comments_number(), 'comments title', 'loquet' ), number_format_i18n( get_comments_number() ), get_the_title() );
echo '</span>';
echo '</div>';
echo '<div>';
echo '<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>';
echo '</div>';
echo '</div>';
echo '</a>';
echo '<div class="gt-comment-list" data-tab-content>';
echo '<ul class="gt-items">';
if( function_exists( 'loquet_comment' ) ) {
$callback = 'loquet_comment';
} else {
$callback = '';
}
wp_list_comments(
array(
'short_ping' => true,
'avatar_size' => 80,
'callback' => $callback,
'reply_text' => esc_html__( 'Reply', 'loquet' ),
)
);
echo '</ul>';
echo '</div>';
echo '</li>';
echo '</ul>';
if( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) {
echo '<div class="gt-pagination">';
echo '<ul>';
if( !empty( get_previous_comments_link() ) ) {
echo '<li>';
echo get_previous_comments_link( esc_html__( 'Previous Comments', 'loquet' ) );
echo '</li>';
}
if( !empty( get_next_comments_link() ) ) {
echo '<li>';
echo get_next_comments_link( esc_html__( 'Next Comments', 'loquet' ) );
echo '</li>';
}
echo '</ul>';
echo '</div>';
}
if( ! comments_open() && get_comments_number() ) {
echo '<p class="gt-notes">' . esc_html__( 'Comments are closed.', 'loquet' ) . '</p>';
}
}
echo '<div class="gt-comment-form">';
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
$comments_args = array(
'class_form' => 'gt-form',
'comment_notes_before' => wpautop( esc_html__( 'Your email address will not be published. Required fields are marked *', 'loquet' ) ),
'title_reply_before' => '<h5 class="gt-title">',
'title_reply_after' => '</h5>',
'title_reply' => esc_html__( 'Leave a Comment', 'loquet' ),
'title_reply_to' => esc_html__( 'Comment', 'loquet' ),
'cancel_reply_link' => esc_html__( 'Cancel Reply', 'loquet'),
'submit_field' => '<div class="gt-item-row"><div class="gt-item">%1$s %2$s</div></div>',
'class_submit' => 'gt-style-1',
'label_submit' => esc_html__( 'Post a Comment', 'loquet'),
'comment_field' => '<div class="gt-item-row">
<div class="gt-item">
<label for="comment-form-message">' . esc_attr__( 'Your Comment *', 'loquet' ) . '</label>
<textarea name="comment" id="comment-form-message" rows="9" tabindex="1"' . $aria_req . '></textarea>
</div>
</div>',
'fields' => apply_filters(
'comment_form_default_fields',
array(
'author' => '<div class="gt-item-row">
<div class="gt-item">
<label for="comment-form-name">' . esc_attr__( 'Name *', 'loquet' ) . '</label>
<input type="text" name="author" id="gt-comment-form-name" value="' . esc_attr( $comment_author ) . '" tabindex="2"' . $aria_req . ' />
</div>',
'email' => ' <div class="gt-item">
<label for="comment-form-email">' . esc_attr__( 'Email *', 'loquet' ) . '</label>
<input type="text" name="email" id="comment-form-email" value="' . esc_attr( $comment_author_email ) . '" tabindex="3"' . $aria_req . ' />
</div>
</div>',
'url' => '<div class="gt-item-row">
<div class="gt-item">
<label for="comment-form-url">' . esc_attr__( 'Website URL', 'loquet' ) . '</label>
<input type="text" name="url" id="comment-form-url" value="' . esc_attr( $comment_author_url ) . '" tabindex="4" />
</div>
</div>',
'cookies' => '<div class="gt-item-row">
<div class="gt-item">
<label class="gt-checkbox" for="wp-comment-cookies-consent">
<input type="checkbox" name="wp-comment-cookies-consent" id="wp-comment-cookies-consent" value="yes"' . $consent . ' />
<svg viewBox="0 0 21 21"> <path d="M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"></path></svg>
<span>' . esc_html__( 'Save my name, email and website in this browser for the next time I comment.', 'loquet' ) . '</span>
</label>
</div>
</div>',
)
),
);
comment_form( $comments_args );
echo '</div>';
echo '</div>';