Edit File by line
/home/barbar84/www/wp-conte.../themes/twentyni...
File: comments.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* The template for displaying comments
[2] Fix | Delete
*
[3] Fix | Delete
* This is the template that displays the area of the page that contains both the current comments
[4] Fix | Delete
* and the comment form.
[5] Fix | Delete
*
[6] Fix | Delete
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
[7] Fix | Delete
*
[8] Fix | Delete
* @package WordPress
[9] Fix | Delete
* @subpackage Twenty_Nineteen
[10] Fix | Delete
* @since Twenty Nineteen 1.0
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
/*
[14] Fix | Delete
* If the current post is protected by a password and
[15] Fix | Delete
* the visitor has not yet entered the password we will
[16] Fix | Delete
* return early without loading the comments.
[17] Fix | Delete
*/
[18] Fix | Delete
if ( post_password_required() ) {
[19] Fix | Delete
return;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
$discussion = twentynineteen_get_discussion_data();
[23] Fix | Delete
?>
[24] Fix | Delete
[25] Fix | Delete
<div id="comments" class="<?php echo comments_open() ? 'comments-area' : 'comments-area comments-closed'; ?>">
[26] Fix | Delete
<div class="<?php echo $discussion->responses > 0 ? 'comments-title-wrap' : 'comments-title-wrap no-responses'; ?>">
[27] Fix | Delete
<h2 class="comments-title">
[28] Fix | Delete
<?php
[29] Fix | Delete
if ( comments_open() ) {
[30] Fix | Delete
if ( have_comments() ) {
[31] Fix | Delete
_e( 'Join the Conversation', 'twentynineteen' );
[32] Fix | Delete
} else {
[33] Fix | Delete
_e( 'Leave a comment', 'twentynineteen' );
[34] Fix | Delete
}
[35] Fix | Delete
} else {
[36] Fix | Delete
if ( '1' == $discussion->responses ) {
[37] Fix | Delete
/* translators: %s: Post title. */
[38] Fix | Delete
printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentynineteen' ), get_the_title() );
[39] Fix | Delete
} else {
[40] Fix | Delete
printf(
[41] Fix | Delete
/* translators: 1: Number of comments, 2: Post title. */
[42] Fix | Delete
_nx(
[43] Fix | Delete
'%1$s reply on &ldquo;%2$s&rdquo;',
[44] Fix | Delete
'%1$s replies on &ldquo;%2$s&rdquo;',
[45] Fix | Delete
$discussion->responses,
[46] Fix | Delete
'comments title',
[47] Fix | Delete
'twentynineteen'
[48] Fix | Delete
),
[49] Fix | Delete
number_format_i18n( $discussion->responses ),
[50] Fix | Delete
get_the_title()
[51] Fix | Delete
);
[52] Fix | Delete
}
[53] Fix | Delete
}
[54] Fix | Delete
?>
[55] Fix | Delete
</h2><!-- .comments-title -->
[56] Fix | Delete
<?php
[57] Fix | Delete
// Only show discussion meta information when comments are open and available.
[58] Fix | Delete
if ( have_comments() && comments_open() ) {
[59] Fix | Delete
get_template_part( 'template-parts/post/discussion', 'meta' );
[60] Fix | Delete
}
[61] Fix | Delete
?>
[62] Fix | Delete
</div><!-- .comments-title-flex -->
[63] Fix | Delete
<?php
[64] Fix | Delete
if ( have_comments() ) :
[65] Fix | Delete
[66] Fix | Delete
// Show comment form at top if showing newest comments at the top.
[67] Fix | Delete
if ( comments_open() ) {
[68] Fix | Delete
twentynineteen_comment_form( 'desc' );
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
?>
[72] Fix | Delete
<ol class="comment-list">
[73] Fix | Delete
<?php
[74] Fix | Delete
wp_list_comments(
[75] Fix | Delete
array(
[76] Fix | Delete
'walker' => new TwentyNineteen_Walker_Comment(),
[77] Fix | Delete
'avatar_size' => twentynineteen_get_avatar_size(),
[78] Fix | Delete
'short_ping' => true,
[79] Fix | Delete
'style' => 'ol',
[80] Fix | Delete
)
[81] Fix | Delete
);
[82] Fix | Delete
?>
[83] Fix | Delete
</ol><!-- .comment-list -->
[84] Fix | Delete
<?php
[85] Fix | Delete
[86] Fix | Delete
// Show comment navigation.
[87] Fix | Delete
if ( have_comments() ) :
[88] Fix | Delete
$prev_icon = twentynineteen_get_icon_svg( 'chevron_left', 22 );
[89] Fix | Delete
$next_icon = twentynineteen_get_icon_svg( 'chevron_right', 22 );
[90] Fix | Delete
$comments_text = __( 'Comments', 'twentynineteen' );
[91] Fix | Delete
the_comments_navigation(
[92] Fix | Delete
array(
[93] Fix | Delete
'prev_text' => sprintf( '%s <span class="nav-prev-text"><span class="primary-text">%s</span> <span class="secondary-text">%s</span></span>', $prev_icon, __( 'Previous', 'twentynineteen' ), __( 'Comments', 'twentynineteen' ) ),
[94] Fix | Delete
'next_text' => sprintf( '<span class="nav-next-text"><span class="primary-text">%s</span> <span class="secondary-text">%s</span></span> %s', __( 'Next', 'twentynineteen' ), __( 'Comments', 'twentynineteen' ), $next_icon ),
[95] Fix | Delete
)
[96] Fix | Delete
);
[97] Fix | Delete
endif;
[98] Fix | Delete
[99] Fix | Delete
// Show comment form at bottom if showing newest comments at the bottom.
[100] Fix | Delete
if ( comments_open() && 'asc' === strtolower( get_option( 'comment_order', 'asc' ) ) ) :
[101] Fix | Delete
?>
[102] Fix | Delete
<div class="comment-form-flex">
[103] Fix | Delete
<span class="screen-reader-text"><?php _e( 'Leave a comment', 'twentynineteen' ); ?></span>
[104] Fix | Delete
<?php twentynineteen_comment_form( 'asc' ); ?>
[105] Fix | Delete
<h2 class="comments-title" aria-hidden="true"><?php _e( 'Leave a comment', 'twentynineteen' ); ?></h2>
[106] Fix | Delete
</div>
[107] Fix | Delete
<?php
[108] Fix | Delete
endif;
[109] Fix | Delete
[110] Fix | Delete
// If comments are closed and there are comments, let's leave a little note, shall we?
[111] Fix | Delete
if ( ! comments_open() ) :
[112] Fix | Delete
?>
[113] Fix | Delete
<p class="no-comments">
[114] Fix | Delete
<?php _e( 'Comments are closed.', 'twentynineteen' ); ?>
[115] Fix | Delete
</p>
[116] Fix | Delete
<?php
[117] Fix | Delete
endif;
[118] Fix | Delete
[119] Fix | Delete
else :
[120] Fix | Delete
[121] Fix | Delete
// Show comment form.
[122] Fix | Delete
twentynineteen_comment_form( true );
[123] Fix | Delete
[124] Fix | Delete
endif; // if have_comments();
[125] Fix | Delete
?>
[126] Fix | Delete
</div><!-- #comments -->
[127] Fix | Delete
[128] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function