• I’m hosting with DreamHost and embedding the page in a Google Site. Everything is working great. But I really want the “Post Comment” text on the button to change. I would also like to change the name above the comment box from “Comment *” to “Story”.

    I am using the twentytwentythree theme so there was initially no functions.php file. I added a functions.php file. The entirety of the file is below:

    <?php function mycustom_comment_form_title_reply($defaults ) { $defaults['title_reply'] = __( 'Share a Story' ); return $defaults; } add_filter( 'comment_form_defaults', 'mycustom_comment_form_title_reply' ); function wpb_comment_reply_text( $link ) { $link = str_replace( 'Post Comment', 'Post Story', $link ); return $link; } add_filter( 'comment_reply_link', 'wpb_comment_reply_text' );

    The first function works correctly and changes the “Leave a Reply” text to “Share a Story”. The second function fails to change the “Post Comment” text. Any recommendations? I was trying to follow this post for instructions:
    https://www.wpbeginner.com/wp-themes/how-to-change-the-reply-text-in-wordpress-comments/

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this code:

    // change submit button text in wordpress comment form
    function wcs_change_submit_button_text( $defaults ) {
    $defaults[‘label_submit’] = ‘Post Story’;
    return $defaults;
    }
    add_filter( ‘comment_form_defaults’, ‘wcs_change_submit_button_text’ );

    Mayuri

    (@mayuripatel)

    Hello @eprebys

    Below code works for me , see this is my wordpress screenshot https://prnt.sc/Arcs1lbQ2cye

    function change_comment_form_submit_label($arg) {
      $arg['label_submit'] = 'Post a Question';
      return $arg;
    }
    add_filter('comment_form_defaults', 'change_comment_form_submit_label', 11);
    Thread Starter eprebys

    (@eprebys)

    Mayuri, your code works great! Everyone, thanks for the help, I appreciate it!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing the Post Comment button text’ is closed to new replies.