File: /home/z/w/a/zwafgyp/dodolodge-net/wp-content/themes/hotel-wp-child/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
*
*/
/*
* 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 if ( get_theme_mod( 'blog_single_comment', true ) ) : ?>
<div id="comments" class="comments-area">
<div class="list-comments">
<?php if ( have_comments() ) { ?>
<h3 class="comments-title">
<?php echo esc_html__( 'Comments', 'hotel-wp' ); ?>
</h3>
<div class="select_order_by">
<span class="span_trier"><?php
$lang = ICL_LANGUAGE_CODE;
if($lang == 'fr'){
esc_html_e('Trier par', 'hotel-wp-child' );
$lang_tri = 'Tri par popularité';
$lang_recent='Tri du plus récent';
$lang_old='Tri du plus ancien';
}else if($lang == 'en'){
esc_html_e('Sort by', 'hotel-wp-child' );
$lang_tri = 'Sort by popularity';
$lang_recent='Sorting the most recent';
$lang_old='Sorting the oldest';
}else if($lang == 'de'){
esc_html_e('Sortieren nach', 'hotel-wp-child' );
$lang_tri = 'Nach Beliebtheit sortieren';
$lang_recent='Sortieren der neuesten';
$lang_old='Sortieren der ältesten';
}else if($lang == 'ru'){
esc_html_e('Сортировать по', 'hotel-wp-child' );
$lang_tri = 'Сортировать по популярности';
$lang_recent='Сортировка самых последних';
$lang_old='Сортировка самого старого';
}else if($lang == 'es'){
esc_html_e('ordenar por', 'hotel-wp-child' );
$lang_tri = 'Ordenar por popularidad';
$lang_recent='Ordenar los más recientes';
$lang_old='Clasificando los más antiguos';
}else if($lang == 'it'){
esc_html_e('Ordina per', 'hotel-wp-child' );
$lang_tri = 'Ordina per popolarità';
$lang_recent='Ordinamento del più recente';
$lang_old='Ordinamento dei più vecchi';
}else if($lang == 'ma'){
esc_html_e('sivanina araka', 'hotel-wp-child' );
$lang_tri = 'Alaharo araka ny lazany';
$lang_recent='Fandaminana ny vao haingana';
$lang_old='Fanasokajiana ny tranainy indrindra';
}
?> :</span>
<select name="orderby" class="orderby" id="selectByOrderby" aria-label="Commande">
<option value="rating" ><?php echo $lang_tri;?></option>
<option value="date_desc" selected="selected"><?php echo $lang_recent; ?></option>
<option value="date_asc" ><?php echo $lang_old; ?></option>
</select>
</div>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-above" class="comment-navigation" role="navigation">
<h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'hotel-wp' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( esc_html__( '← Older Comments', 'hotel-wp' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments →', 'hotel-wp' ) ); ?></div>
</nav><!-- #comment-nav-above -->
<?php endif; // check for comment navigation ?>
<ul class="comment-list">
<?php wp_list_comments( 'type=all&callback=thim_comment_evoluer' ); ?>
</ul>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="comment-navigation" role="navigation">
<h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'hotel-wp' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( esc_html__( '← Older Comments', 'hotel-wp' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments →', 'hotel-wp' ) ); ?></div>
</nav><!-- #comment-nav-below -->
<?php endif; // check for comment navigation ?>
<?php } else {
echo esc_html__( 'No comments yet! You will be the first one to comment.', 'hotel-wp' );
} // have_comments() ?>
<?php if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'hotel-wp' ); ?></p>
<?php endif; ?>
</div>
<div style="display:none;">
<?php
$lang = ICL_LANGUAGE_CODE;
if($lang == 'fr'){
echo '<span class="error-required-form">Ce champ est obligatoire.</span>';
echo '<span class="error-email-form">Veuillez saisir une adresse e-mail valide</span>';
}else if($lang == 'en'){
echo '<span class="error-required-form">This field is required</span>';
echo '<span class="error-email-form">Please enter a valid email address</span>';
}else if($lang == 'de'){
echo '<span class="error-required-form">Dieses Feld wird benötigt</span>';
echo '<span class="error-email-form">Bitte geben Sie eine gültige E-Mail-Adresse ein</span>';
}else if($lang == 'ru'){
echo '<span class="error-required-form">Это поле обязательно к заполнению</span>';
echo '<span class="error-email-form">Пожалуйста, введите действительный адрес электронной почты</span>';
}else if($lang == 'es'){
echo '<span class="error-required-form">Este campo es obligatorio</span>';
echo '<span class="error-email-form">Por favor, introduce una dirección de correo electrónico válida</span>';
}else if($lang == 'it'){
echo '<span class="error-required-form">Questo campo è obbligatorio</span>';
echo '<span class="error-email-form">Si prega di inserire un indirizzo email valido</span>';
}else if($lang == 'ma'){
echo '<span class="error-required-form">Tsy maintsy fenoina ity saha ity</span>';
echo '<span class="error-email-form">Mampidira adiresy mailaka mandeha azafady</span>';
}
?>
</div>
<div class="form-comment">
<?php
if($lang == 'ma'){
comment_form( array(
'comment_field' => '<p class="comment-form-comment"><textarea placeholder="' . esc_attr__( 'Comment *', 'hotel-wp' ) . '" id="comment" name="comment" cols="45" rows="8" aria-required="true">' . '</textarea></p>',
'title_reply' => 'Mametraha hevitra',
) );
}else{
comment_form( array(
'comment_field' => '<p class="comment-form-comment"><textarea placeholder="' . esc_attr__( 'Comment *', 'hotel-wp' ) . '" id="comment" name="comment" cols="45" rows="8" aria-required="true">' . '</textarea></p>'
) );
} ?>
</div>
</div><!-- #comments -->
<?php endif; ?>