Имеется проблема отображения кнопки ответа для parent комментариев ('title_reply_to') и соответственно children комментариев в файле сomments.php.
Делаю всё согласно доке WordPress'а, перепробовал десятки подсказок в решении проблемы. Что исправить в данном коде для отображения 'title_reply_to'?
<?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://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package wp-eo-blog
*/
/*
* 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 ( have_comments() ) : ?>
<div class="comments">
<h4 class="comments-title">
<!-- COMMENTS TITLE -->
<?php
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
echo 'One Comment';
} else {
echo $comments_number . ' Comments';
}
?>
</h4>
<!-- COMMENT LIST -->
<div class="comment-list">
<?php
wp_list_comments( array(
'style' => 'div',
'short_ping' => true,
'avatar_size' => 50,
) );
?>
</div>
<!-- COMMENTS -->
<?php
$defaults = [
'fields' => [
'author' => '<p class="comment-form-author">
<label class="b3__demibold text-navy500" for="author">' . __( 'Name' ) . ( $req ? ' <span class="required text-red500">*</span>' : '' ) . '</label>
<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . $html_req . ' />
</p>',
'email' => '<p class="comment-form-email">
<label class="b3__demibold text-navy500" for="email">' . __( 'Email' ) . ( $req ? ' <span class="required text-red500">*</span>' : '' ) . '</label>
<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" aria-describedby="email-notes"' . $aria_req . $html_req . ' />
</p>',
'url' => '<p class="comment-form-url display-none">
<label class="b3__demibold" for="url">' . __( 'Website' ) . '</label>
<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />
</p>',
'cookies' => '<p class="comment-form-cookies-consent display-none">'.
sprintf( '<input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"%s />', $consent ) .'
<label for="wp-comment-cookies-consent">'. __( 'Save my name, email, and website in this browser for the next time I comment.' ) .'</label>
</p>',
],
'comment_field' => '<p class="comment-form-comment">
<label class="b3__demibold text-navy500" for="comment">' . _x( 'Comment', 'noun' ) . '</label>
<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required="required"></textarea>
</p>',
'must_log_in' => '<p class="must-log-in">' .
sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
</p>',
'logged_in_as' => '<p class="logged-in-as">' .
sprintf( __( '<a href="%1$s" aria-label="Logged in as %2$s. Edit your profile.">Logged in as %2$s</a>. <a href="%3$s">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
</p>',
'comment_notes_before' => '<p class="comment-notes display-none">
<span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>'.
( $req ? $required_text : '' ) . '
</p>',
'comment_notes_after' => '',
'id_form' => 'commentform',
'id_submit' => 'submit',
'class_container' => 'comment-respond',
'class_form' => 'comment-form',
'class_submit' => 'submit',
'name_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
'title_reply_to' => __( 'Leave a Reply to %s' ),
'title_reply_before' => '<h5 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h5>',
'cancel_reply_before' => ' <small>',
'cancel_reply_after' => '</small>',
'cancel_reply_link' => __( 'Cancel reply' ),
'label_submit' => __( 'Post Comment' ),
'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />',
'submit_field' => '<p class="form-submit">%1$s %2$s</p>',
'format' => 'xhtml',
];
comment_form( $defaults );
?>
<!-- PAGINATION COMMENTS -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
<nav class="navigation comment-navigation" role="navigation">
<div class="nav-previous"><?php previous_comments_link( 'Older Comments' ); ?></div>
<div class="nav-next"><?php next_comments_link( 'Newer Comments' ); ?></div>
</nav>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
<p class="no-comments">Comments are closed.</p>
<?php endif; ?>