File: /www/wwwroot/pulitocucito.it/wp-content/themes/laundry/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 Laundry
*/
/*
* 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;
}
$laundry_opt = laundry_get_options();
$theme = isset( $laundry_opt['laundry_demo_select'] ) ? $laundry_opt['laundry_demo_select'] : 1;
if ( $theme == '2' ) {
?>
<div class="tt-comments-layout tt-comments-layout__top">
<?php
// You can start editing here -- including this comment!
if ( have_comments() ) :
?>
<div class="tt-comments-layout__title">
<?php
$laundry_comment_count = get_comments_number();
if ( '1' === $laundry_comment_count ) {
printf(
/* translators: 1: title. */
esc_html__( 'One Comment', 'laundry' )
);
} else {
printf(// WPCS: XSS OK.
/* translators: 1: comment count number, 2: title. */
esc_html( _nx( 'Comment (%1$s)', 'Comments (%1$s)', $laundry_comment_count, 'comments title', 'laundry' ), 'laundry' ),
number_format_i18n( $laundry_comment_count )
);
}
?>
</div>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'laundry' ); ?></h2>
<div class="nav-links">
<div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'laundry' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'laundry' ) ); ?></div>
</div><!-- .nav-links -->
</nav><!-- #comment-nav-above -->
<?php endif; // Check for comment navigation. ?>
<?php
wp_list_comments(
array(
'style' => 'div',
'short_ping' => true,
'avatar_size' => 92,
'walker' => new Laundry_Comment_Walker(),
)
);
?>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'laundry' ); ?></h2>
<div class="nav-links">
<div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'laundry' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'laundry' ) ); ?></div>
</div><!-- .nav-links -->
</nav><!-- #comment-nav-below -->
<?php
endif; // Check for comment navigation.
endif; // Check for have_comments().
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'laundry' ); ?></p>
<?php
endif;
$args = array(
'class_form' => 'form-default',
'id_submit' => 'submit',
'class_submit' => 'btn btn-default btn-top',
'name_submit' => 'submit',
'title_reply' => esc_html__( 'Leave a comment', 'laundry' ),
'title_reply_to' => esc_html__( 'Leave a comment to %s', 'laundry' ),
'cancel_reply_link' => esc_html__( 'Cancel Reply', 'laundry' ),
'label_submit' => esc_html__( 'Post Comment', 'laundry' ),
'submit_field' => '%1$s %2$s',
'submit_button' => '<div class="tt-btn"><span class="mask">' . esc_html__( 'Post Comment', 'laundry' ) . '</span><button type="submit" name="%1$s" id="%2$s" class="%3$s button">%4$s</button></div>',
'format' => 'xhtml',
'comment_field' => '<div class="form-group"><label class="control-label" for="comment">' . esc_html_x( 'Comment', 'noun', 'laundry' ) . '</label><textarea id="comment" name="comment" class="textarea-custom input-full form-control" rows="10" aria-required="true"></textarea></div>',
'must_log_in' => '<p class="must-log-in">' .
wp_kses_post(
sprintf(
__( 'You must be <a href="%s">logged in</a> to post a comment.', 'laundry' ),
wp_login_url( apply_filters( 'the_permalink', get_permalink() ) )
)
) . '</p>',
'logged_in_as' => '<p class="logged-in-as">' .
wp_kses_post(
sprintf(
__( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'laundry' ),
admin_url( 'profile.php' ),
$user_identity,
wp_logout_url( apply_filters( 'the_permalink', get_permalink() ) )
)
) . '</p>',
'fields' => apply_filters(
'comment_form_default_fields',
array(
'author' =>
'<div class="form-group">
<label class="control-label">' . esc_html__( 'Name', 'laundry' ) . ' ' . ( $req ? '<span class="required">*</span>' : '' ) . '</label>' .
'<input id="author" class="form-control" name="author" type="text" placeholder="' . esc_html__( 'Name', 'laundry' ) . '" value="' . esc_attr( $commenter['comment_author'] ) .
'" /></div>',
'email' =>
'<div class="form-group">
<label class="control-label">' . esc_html__( 'Email', 'laundry' ) . ( $req ? '<span class="required">*</span>' : '' ) . '</label>' .
'<input id="email" class="form-control" name="email" type="text" placeholder="Email" value="' . esc_attr( $commenter['comment_author_email'] ) .
'" /></div>',
'url' =>
'<div class="form-group">
<label class="control-label">' . esc_html__( 'Website', 'laundry' ) . '</label>' .
'<input id="url" class="form-control" name="url" type="text" placeholder="' . esc_html__( 'Website', 'laundry' ) . '" value="' . esc_attr( $commenter['comment_author_url'] ) .
'" /></div>',
)
),
);
?>
</div>
<div class="form-single-post form-single-post__top">
<?php
comment_form( $args );
?>
</div>
<?php } else { ?>
<div id="comments" class="comments-area">
<?php
// You can start editing here -- including this comment!
if ( have_comments() ) :
?>
<h4 class="comments-title">
<?php
printf( // WPCS: XSS OK.
esc_html( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'laundry' ) ),
number_format_i18n( get_comments_number() ),
'<span>' . get_the_title() . '</span>'
);
?>
</h4>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'laundry' ); ?></h2>
<div class="nav-links">
<div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'laundry' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'laundry' ) ); ?></div>
</div><!-- .nav-links -->
</nav><!-- #comment-nav-above -->
<?php endif; // Check for comment navigation. ?>
<div class="comment-list comments">
<?php
wp_list_comments(
array(
'style' => 'div',
'short_ping' => true,
'avatar_size' => 92,
'walker' => new Laundry_Comment_Walker(),
)
);
?>
</div><!-- .comment-list -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'laundry' ); ?></h2>
<div class="nav-links">
<div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'laundry' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'laundry' ) ); ?></div>
</div><!-- .nav-links -->
</nav><!-- #comment-nav-below -->
<?php
endif; // Check for comment navigation.
endif; // Check for have_comments().
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'laundry' ); ?></p>
<?php
endif;
$args = array(
'id_form' => 'commentform',
'class_form' => 'boxed-form',
'id_submit' => 'submit',
'class_submit' => 'btn btn-default btn-top',
'name_submit' => 'submit',
'title_reply' => esc_html__( 'Leave a comment', 'laundry' ),
'title_reply_to' => esc_html__( 'Leave a comment to %s', 'laundry' ),
'cancel_reply_link' => esc_html__( 'Cancel Reply', 'laundry' ),
'label_submit' => esc_html__( 'Leave a Comment', 'laundry' ),
'format' => 'xhtml',
'comment_field' => '<div class="form-group"><label class="control-label" for="comment">' . esc_html_x( 'Comment', 'noun', 'laundry' ) . '</label><textarea id="comment" name="comment" class="textarea-custom input-full form-control" rows="10" aria-required="true"></textarea></div>',
'must_log_in' => '<p class="must-log-in">' .
wp_kses_post(
sprintf(
__( 'You must be <a href="%s">logged in</a> to post a comment.', 'laundry' ),
wp_login_url( apply_filters( 'the_permalink', get_permalink() ) )
)
) . '</p>',
'logged_in_as' => '<p class="logged-in-as">' .
wp_kses_post(
sprintf(
__( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'laundry' ),
admin_url( 'profile.php' ),
$user_identity,
wp_logout_url( apply_filters( 'the_permalink', get_permalink() ) )
)
) . '</p>',
'fields' => apply_filters(
'comment_form_default_fields',
array(
// 'bef_info_fild' => '',
'author' =>
'<div class="row">
<div class="col-md-12 col-lg-12">
<div class="form-group">
<label class="control-label">' . esc_html__( 'Name', 'laundry' ) . ' ' . ( $req ? '<span class="required">*</span>' : '' ) . '</label>' .
'<input id="author" class="form-control" name="author" type="text" placeholder="' . esc_html__( 'Name', 'laundry' ) . '" value="' . esc_attr( $commenter['comment_author'] ) .
'" /></div>
</div>
</div>',
'email' =>
'<div class="row">
<div class="col-md-12 col-lg-12">
<div class="form-group">
<label class="control-label">' . esc_html__( 'Email', 'laundry' ) . ( $req ? '<span class="required">*</span>' : '' ) . '</label>' .
'<input id="email" class="form-control" name="email" type="text" placeholder="[email protected]" value="' . esc_attr( $commenter['comment_author_email'] ) .
'" /></div></div>
</div>',
'url' =>
'<div class="row">
<div class="col-md-12 col-lg-12">
<div class="form-group">
<label class="control-label">' . esc_html__( 'Website', 'laundry' ) . '</label>' .
'<input id="url" class="form-control" name="url" type="text" placeholder="' . esc_html__( 'Website', 'laundry' ) . '" value="' . esc_attr( $commenter['comment_author_url'] ) .
'" /></div></div>
</div>',
)
),
);
comment_form( $args );
?>
</div>
<?php } ?>