0

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 enter image description here

  • 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 Jan 11 at 21:32
1

it 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 &ldquo;%1$s&rdquo;', '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 &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $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

|improve this answer|||||
  • 1
    It worked. Thanks alot @YounesDro – Farhan Ali Jan 11 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.