Answer the question
In order to leave comments, you need to log in
Why isn't "Comment pending review" displayed in Wordpress?
I have 2 fields before submitting a comment.
Email and Name.
Both fields are optional . When both fields are filled, then the inscription
comment pending reviewappears. When at least 1 field is empty, it redirects to the very top of the page and the comment ID is added to the URL, and the comments are empty. The comments themselves are open and can be left anonymously and without registration.
<?php if (comments_open()) { ?>
<?php if (get_comments_number() == 0) { ?>
<ul class="list">
<li>Оставьте первый комментарий - автор старался.</li>
</ul>
<?php } else { ?>
<ol style="list-style: none" class="commentlist">
<?php
function zad_comment($comment, $args, $depth){
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div class='kom' id="comment-<?php comment_ID(); ?>" itemprop="comment" itemscope="itemscope" itemtype="http://schema.org/Comment">
<div class="comment-author vcar">
<div itemprop="datePublished" class="comment-meta commentmetadata" style="float: right;">
<?php edit_post_link(); ?>
<?php printf( __('%1$s'), get_comment_date('Y-m-d')); ?>
</div>
<?php printf(__('<cite class="fn" itemprop="creator"><strong>%s</strong></cite> <span class="fn"></span>'), get_comment_author_link()) ?>
<?php comment_time('H:i'); ?>
</div>
<?php if ($comment->comment_approved == '0') : ?>
<p style="font-style:bold"><?php _e('Ваш комментарий ожидает проверки.') ?></p>
<br>
<?php endif; ?>
<p itemprop="text"><?php comment_text() ?></p>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
<?php }
$args = array(
'reply_text' => 'Ответить',
'callback' => 'zad_comment'
);
wp_list_comments($args);
?>
</ol>
<?php } ?>
<?php
$fields = array(
'author' => '<p class="comment-form-author"><label for="author">(необязательно) ' . __( 'Name' ) . ($req ? '<span class="required">*</span>' : '') . '</label><input type="text" id="author" name="author" class="author" value="' . esc_attr($commenter['comment_author']) . '" placeholder="" pattern="[A-Za-zА-Яа-я]{3,}" maxlength="30" autocomplete="on" tabindex="1" ></p>',
'email' => '<p class="comment-form-email"><label for="email">(необязательно) ' . __( 'Email') . ($req ? '<span class="required">*</span>' : '') . '</label><input type="email" id="email" name="email" class="email" value="' . esc_attr($commenter['comment_author_email']) . '" placeholder="[email protected]" maxlength="30" autocomplete="on" tabindex="2" ></p>'
);
$args = array(
'comment_notes_after' => '',
'comment_notes_before' => '',
'logged_in_as' => '',
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" class="comment-form" cols="45" rows="4" aria-required="true" placeholder="Текст сообщения..."></textarea></p>',
'cancel_reply_link' => __( 'Отмена' ),
'must_log_in' => 'false',
'title_reply' => __( '' ),
'label_submit' => 'Отправить',
'fields' => apply_filters('comment_form_default_fields', $fields)
);
comment_form($args);
?>
<?php } else { ?>
<h3>Обсуждения закрыты для данной страницы</h3>
<?php }
?>
Answer the question
In order to leave comments, you need to log in
The VI determines the ownership of the author's comment by e-mail. Therefore, without his mandatory input, in principle, there will be no messages "your comment is awaiting moderation".
We put a checkbox in the admin panel "The author of the comment must specify a name and e-mail", we oblige the user to enter soap and everything will be fine.
As I understand it, this is a handwritten theme or some kind of weak template, I advise you to install the plugin for comments, or change the template .. + settings to help .... Your site looked really not working
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question