How to customize the title from comments form?

I want to change the string on comments that is:n thoughts on post title is here I want to change that string from func

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
Add a comment  | 

1 Answer 1

Reset to default 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744843248a4596683.html

相关推荐

  • How to customize the title from comments form?

    I want to change the string on comments that is:n thoughts on post title is here I want to change that string from func

    2天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信