File "comments.php"
Full Path: /home/stylijtl/public_html/wp-content/themes/acens/comments.php
File size: 5.93 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/**
* The template for displaying Comments.
*
* The area of the page that contains comments and the comment form.
* 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.
*/
if ( post_password_required() )
return;
?>
<?php $comment_detail = get_post_meta(get_the_ID(),'_cmb_comment_detail', true); ?>
<!-- Comment -->
<?php if($comment_detail == 'demo'){?>
<?php if ( have_comments() ) : ?>
<div class="col-md-6">
<?php wp_list_comments('callback=acens_theme_comment'); ?>
</div>
<?php endif; ?>
<?php
if ( is_singular() ) wp_enqueue_script( "comment-reply" );
$aria_req = ( $req ? " aria-required='true'" : '' );
$comment_args = array(
'id_form' => 'contact_form',
'class_form' => 'contact__form',
'title_reply'=> esc_html__( 'Leave A Comment', 'acens' ),
'fields' => apply_filters( 'comment_form_default_fields', array(
'author' => '
<div class="col-md-12 form-group">
<input type="text" name="author" placeholder="'.esc_attr__('Full Name *', 'acens').'" required="'.esc_attr__('required', 'acens').'" data-error="'.esc_attr__('Name is required.', 'acens').'">
</div>',
'email' => '
<div class="col-md-12 form-group">
<input type="email" name="email" placeholder="'.esc_attr__('Email Address *', 'acens').'" required="'.esc_attr__('required', 'acens').'" data-error="'.esc_attr__('Valid email is required.', 'acens').'">
</div>',
) ),
'comment_field' => '<div class="col-md-12">
<textarea id="message" name="comment" cols="40" rows="4" placeholder="'.esc_attr__('Write A Comment', 'acens').'" required="'.esc_attr__('required', 'acens').'" data-error="'.esc_attr__('Please,leave us a message.', 'acens').'"></textarea>
</div>
',
'label_submit' => esc_html__( 'Post A Comment', 'acens' ),
'submit_button' => '<button class="button-4" id="submit" type="submit"><span>'.esc_attr__('%4$s', 'acens').'</span></button>',
'submit_field' => '<div class="col-md-12">
'.esc_attr__('%1$s', 'acens').' '.esc_attr__('%2$s', 'acens').'
</div>',
'comment_notes_before' => '',
'comment_notes_after' => '',
)
?>
<div class="col-md-5 offset-md-1 mb-30">
<?php if ( comments_open() ) : ?>
<?php comment_form($comment_args); ?>
<?php endif; ?>
</div>
<?php }else{?>
<?php if ( have_comments() ) : ?>
<div class="col-md-12">
<?php wp_list_comments('callback=acens_theme_comment2'); ?>
</div>
<?php endif; ?>
<div class="col-md-12">
<!-- START PAGINATION -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
<div class="pagination_area">
<nav>
<ul class="pagination">
<li> <?php paginate_comments_links(
array(
'prev_text' => wp_specialchars_decode('<i class="fa fa-angle-left"></i>',ENT_QUOTES),
'next_text' => wp_specialchars_decode('<i class="fa fa-angle-right"></i>',ENT_QUOTES),
)); ?>
</li>
</ul>
</nav>
</div>
<?php endif; ?>
<!-- END PAGINATION -->
</div>
<?php
if ( is_singular() ) wp_enqueue_script( "comment-reply" );
$aria_req = ( $req ? " aria-required='true'" : '' );
$comment_args = array(
'id_form' => 'contact_form',
'class_form' => 'contact__form',
'title_reply'=> esc_html__( 'Leave A Comment', 'acens' ),
'fields' => apply_filters( 'comment_form_default_fields', array(
'author' => '
<div class="col-md-12 form-group">
<input type="text" name="author" placeholder="'.esc_attr__('Full Name *', 'acens').'" required="'.esc_attr__('required', 'acens').'" data-error="'.esc_attr__('Name is required.', 'acens').'">
</div>',
'email' => '
<div class="col-md-12 form-group">
<input type="email" name="email" placeholder="'.esc_attr__('Email Address *', 'acens').'" required="'.esc_attr__('required', 'acens').'" data-error="'.esc_attr__('Valid email is required.', 'acens').'">
</div>',
) ),
'comment_field' => '<div class="col-md-12">
<textarea id="message" name="comment" cols="40" rows="4" placeholder="'.esc_attr__('Write A Comment', 'acens').'" required="'.esc_attr__('required', 'acens').'" data-error="'.esc_attr__('Please,leave us a message.', 'acens').'"></textarea>
</div>
',
'label_submit' => esc_html__( 'Post A Comment', 'acens' ),
'submit_button' => '<button class="button-4 %3$s" name="%1$s" id="submit %2$s" type="submit"><span>'.esc_attr__('%4$s', 'acens').'</span></button>',
'submit_field' => '<div class="col-md-12">
'.esc_attr__('%1$s', 'acens').' '.esc_attr__('%2$s', 'acens').'
</div>',
'comment_notes_before' => '',
'comment_notes_after' => '',
)
?>
<div class="col-md-12 comment_detail mb-30">
<?php if ( comments_open() ) : ?>
<?php comment_form($comment_args); ?>
<?php endif; ?>
</div>
<?php } ?>