I want to change the string on comments that is: n thoughts on post title is here I want to change that string from functions.php Please check the screenshot
I want to change the string on comments that is: n thoughts on post title is here I want to change that string from functions.php Please check the screenshot
Share Improve this question edited Jan 11, 2020 at 21:08 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Jan 11, 2020 at 20:13 Farhan AliFarhan Ali 291 silver badge8 bronze badges 1- check the file comments.php of your theme; then change it by creating a child theme and editing comments.php in that child theme. changing the text might not be possible with fiunctions.php... – Michael Commented Jan 11, 2020 at 21:32
1 Answer
Reset to default 1it depends on the theme, but in general Comments are generated by the template : comments.php
, you found something like that (example) :
<?php
$dro_pizza_comment_count = get_comments_number();
if ( '1' === $dro_pizza_comment_count ) {
printf(
/* translators: 1: title. */
esc_html__( 'One thought on “%1$s”', 'dro-pizza' ),'<span>' . esc_html( get_the_title() ) . '</span>'
);
} else {
printf( // WPCS: XSS OK.
/* translators: 1: comment count number, 2: title. */
esc_html( _nx( '%1$s thoughts on “%2$s”', '%1$s thoughts on “%2$s”', $dro_pizza_comment_count, 'comments title', 'dro-pizza' ) ),
number_format_i18n( $dro_pizza_comment_count ),
'<span>' . esc_html( get_the_title() ) . '</span>'
);
}
?>
So we can change the words : thought
by whatever we want