File: /var/www/Application/wp-content/themes/zoomy/comments.php
<?php
/**
* The template for displaying comments
*
* This is the template that displays the area of the page that contains both the current comments
* and the comment form.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package zoomy
*/
/*
* 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.
*/
$opt = get_option( 'zoomy_opt' );
$is_single_post_meta = isset( $opt['is_single_post_meta'] ) ? $opt['is_single_post_meta'] : '1';
$is_single_comment_meta = isset( $opt['is_single_comment_meta'] ) ? $opt['is_single_comment_meta'] : '1';
if ( is_single() ) {
$form_spacer = have_comments() ? 'mt-0' : 'mt-55';
}
if ( post_password_required() ) {
return;
}
if ( have_comments() ) :
if ( $is_single_post_meta == '1' && $is_single_comment_meta == '1' ) : ?>
<div class="row mt-55 mb-2">
<div class="col-lg-12 text-left">
<h4 class="comment-section-heading">
<?php zoomy_comment_count( get_the_ID() ) ?>
</h4>
</div>
</div>
<?php endif; ?>
<div class="comments-area">
<ul class="latest-commmnet">
<?php
wp_list_comments(
array(
'style' => 'ul',
'short_ping' => true,
'walker' => new Zoomy_Walker_Comment,
)
);
the_comments_navigation();
?>
</ul>
</div>
<?php endif; ?>
<div class="comments-form-area mb-xl-0 mb-lg-0 mb-md-80 mb-xs-80 <?php echo esc_attr( $form_spacer ); ?>">
<?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
<div class="row">
<div class="col-lg-12 text-center mb-40">
<p class="no-comments alert alert-warning"><?php esc_html_e( 'Comments are closed.', 'zoomy' ); ?></p>
</div>
</div>
<?php endif;
$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"';
$fields = array(
'author' => '<div class="col-lg-6 mb-20"><input type="text" placeholder="' . esc_attr__( "Your name", "zoomy" ) . '" name="author" id="name" value="' . esc_attr( $commenter['comment_author'] ) . '" ' . $aria_req . '>' . '</div>',
'email' => '<div class="col-lg-6 mb-20"> <input type="email" placeholder="' . esc_attr__( "Your email", "zoomy" ) . '" name="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" ' . $aria_req . '>' . '</div>',
'url' => '',
'cookies' => '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
'<label for="wp-comment-cookies-consent">' . esc_html__( "Save my name and email in this browser for the next time I comment.", "zoomy" ) . '</label></p>'
);
$comments_args = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'class_form' => 'row comments-form',
'class_submit' => 'theme_btn comment_btn',
'title_reply_before' => '<h2>',
'title_reply' => esc_html__( 'Leave a comment', 'zoomy' ),
'title_reply_after' => '</h2>',
'comment_notes_before' => '<p class="comment-short-insturction">' . esc_html__( "Sign in to post your comment or sine up if you dont have any account.", "zoomy" ) . '</p>',
'comment_field' => '<div class="col-lg-12 mb-20"><textarea placeholder="' . esc_attr__( "Write Your Comment", "zoomy" ) . '" cols="30" rows="10" name="comment" id="comment"></textarea></div>',
'comment_notes_after' => '',
);
comment_form( $comments_args ); ?>
</div>