WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Changing "Leave a Reply" Twenty Eleven (10 posts)

  1. riledesmag
    Member
    Posted 2 years ago #

    I was trying to find information about that topic. However, I just found information about Twenty Ten. I would like to change the wording "Leave a Reply" in the comment/reply box in the Twenty Eleven theme. Thanks.

  2. equalmark
    Member
    Posted 2 years ago #

    Try line 77 of content.php

  3. riledesmag
    Member
    Posted 2 years ago #

    I tried that to change the wording "Leave a Reply" that appears below the post. What I would like is to change the wording inside the Comment/Reply Box. Thank you though.

    http://www.blog.web6.org/wp-content/uploads/2010/08/wordpresschangeleaveareply.jpg

  4. JennAtFFP
    Member
    Posted 2 years ago #

    You can add some code to the comment.php

    I didn't like the "Leave a Reply" text either and wanted to personalize the message to match my personality.

    If you're using a child theme, you'll need to copy the comment.php file over so your child theme can use it otherwise, if you change the parent, the changes may reset to the default during an update.

    Change the line of code in the original comment php from

    <?php comment_form(); ?>

    to something like this only change the text inside the single quote mark Comments Make Me Happy to whatever you like.

    <?php comment_form(array('title_reply'=>'Comments Make Me Happy')); ?>

    BTW-I found the line of code towards the bottom of the Twenty Eleven theme file.

    Good luck!

  5. riledesmag
    Member
    Posted 2 years ago #

    Thank you JennAtFFP. I also found another way to change the title in the comment form of the Twenty Eleven theme. It's via FTP, opening and changing the file 'comment-form.php' in the /wp-include/ folder. There is a line of code that explicitly says "title_reply =>...'.
    Thank you guys for your help.
    The thread was resolved.

  6. miacarr
    Member
    Posted 2 years ago #

    To be more precise, the file riledesmag refers to is called "comment-template.php" and it's inside the "wp-includes" folder. The form to edit is at the bottom of the comment-template.php page.

    That is, if using wp 3.2.1. Otherwise you'll be wasting time - like me, looking for a file that does not exist.

    cheers!

  7. harryts
    Member
    Posted 2 years ago #

    Another question. How can I change the wording "Leave a Reply" into Cyrillic "Добавить комментарий"? I created the child comments.php-file, but the php-syntax doesn't understand things like <?php comment_form(array('title_reply'=>'Добавить комментарий')); ?>
    Thanks.

  8. harryts
    Member
    Posted 2 years ago #

    Oh! Sorry. That was simple: just to change the encoding from ANSI into UTF-8.

  9. peter_quinn
    Member
    Posted 2 years ago #

    JennAtFFP has the best answer to the original question. It is best to avoid editing core files or parent theme files that may get overwritten with each update.

    Creating the array can be a little tricky. You can find the variables around line 1525 of /wp-includes/comment-template.php, but don't edit that file directly. Use a copy of comments.php in your child theme.

    Here is another example that changes the "leave a reply" text, the message below it, and includes a variable for the required fields text.

    <?php $required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' ); comment_form(array('title_reply'=>'Leave a note...','comment_notes_before'=>'<p class="comment-notes">' . __( 'Your email address will not be published or shared.' ) . ( $req ? $required_text : '' ) . '</p>'')); ?>

  10. eagle8154
    Member
    Posted 1 year ago #

    Could anyone assist me with combining the code JennAtFFP provided for changing the comment form title, but also changing the other labels, plus, eliminating the website field altogether.

    Here is the code I found that will change everything except the comment form title:

    <?php $comment_args = array( 'fields' => apply_filters( 'comment_form_default_fields', array(
        'author' => '<p class="comment-form-author">' .
                    '<label for="author">' . __( 'Your Name' ) . '</label> ' .
                    ( $req ? '<span class="required">*</span>' : '' ) .
                    '<input id="author" name="author" type="text" value="' .
                    esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />' .
                    '</p><!-- #form-section-author .form-section -->',
        'email'  => '<p class="comment-form-email">' .
                    '<label for="email">' . __( 'Your Email' ) . '</label> ' .
                    ( $req ? '<span class="required">*</span>' : '' ) .
                    '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . 
    
    '" size="30"' . $aria_req . ' />' .
    		'</p><!-- #form-section-email .form-section -->',
        'url'    => '' ) ),
        'comment_field' => '<p class="comment-form-comment">' .
                    '<label for="comment">' . __( 'Let us know what you have to say:' ) . '</label>' .
                    '<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>' .
                    '</p><!-- #form-section-comment .form-section -->',
        'comment_notes_after' => '',
    );
    comment_form($comment_args); ?>

    and, of course here is the code for changing the title:

    <?php comment_form(array('title_reply'=>'Comments Make Me Happy')); ?>

    I just need to know how to add the two together.

    Thanks,
    Jeff

Topic Closed

This topic has been closed to new replies.

About this Topic