WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to change wording of "Leave a Reply" (39 posts)

  1. skyeandstone
    Member
    Posted 4 years ago #

    I would like to change "Leave a Reply" to "Leave a Condolence" on the funeral home blog. I've been aimlessly searching files with no luck.

    Using wp theme Twenty Ten wrapped in a Rapidweaver theme.

    [moderated url]

    Thanks

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try looking in the theme's comments.php file.

  3. skyeandstone
    Member
    Posted 4 years ago #

    I thought it would be there too, but it's not.

    I looked through all of the pages on my edit page and the words "Leave a Reply" are not there.

    I also looked at all of the wordpress files in my blog folder on my server.

    Is there a hidden comments template?

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    No there isn;t. Does your theme have a comments.php file?

  5. skyeandstone
    Member
    Posted 4 years ago #

    Yes. I found a comments.php on my dashboard edit themes page.
    There is also a file by that name in my blog folder on my server.

    Something interesting, when I view source of my page the "Leave a Reply" is inside an area labeled with a plugin name WP-Blog. Not sure if that's relevant or not, but it's the only place I've seen the words I'm looking for.

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    I've checked the source of your pages and there's no apparent plugin involvement. Looks like the normal comments.php theme template to me - the one on your dashboard edit themes page.

  7. skyeandstone
    Member
    Posted 4 years ago #

    Here's what's in the comment.php;

    <?php
    /**
     * The template used to display Comments
     *
     * The area of the page that contains both current comments
     * and the comment form.  The actual display of comments is
     * handled by a callback to twentyten_comment which is
     * located in the functions.php file
     *
     * @package WordPress
     * @subpackage Twenty Ten
     * @since 3.0.0
     */
    ?>
    
    			<div id="comments">
    <?php if ( post_password_required() ) : ?>
    				<div class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></div>
    			</div><!-- .comments -->
    <?php
    		return;
    	endif;
    ?>
    
    <?php
    	// You can start editing here -- including this comment!
    ?>
    
    <?php if ( have_comments() ) : ?>
    			<h3 id="comments-title"><?php comments_number(
    				sprintf( __( 'No Responses to %s', 'twentyten' ), '<em>' . get_the_title() . '</em>' ),
    				sprintf( __( 'One Response to %s', 'twentyten' ), '<em>' . get_the_title() . '</em>' ),
    				sprintf( __( '%% Responses to %s', 'twentyten' ), '<em>' . get_the_title() . '</em>' )
    			); ?> </h3>
    
    <?php if ( get_comment_pages_count() > 1 ) : // are there comments to navigate through ?>
    			<div class="navigation">
    				<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyten' ) ); ?></div>
    				<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyten' ) ); ?></div>
    			</div>
    <?php endif; // check for comment navigation ?>
    
    			<ol class="commentlist">
    				<?php wp_list_comments( array( 'callback' => 'twentyten_comment' ) ); ?>
    			</ol>
    
    <?php if ( get_comment_pages_count() > 1 ) : // are there comments to navigate through ?>
    			<div class="navigation">
    				<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyten' ) ); ?></div>
    				<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyten' ) ); ?></div>
    			</div>
    <?php endif; // check for comment navigation ?>
    
    <?php else : // this is displayed if there are no comments so far ?>
    
    <?php if ( comments_open() ) : // If comments are open, but there are no comments ?>
    
    <?php else : // if comments are closed ?>
    
    		<p class="nocomments"><?php _e( 'Comments are closed.', 'twentyten' ); ?></p>
    
    <?php endif; ?>
    <?php endif; ?>
    
    <?php comment_form(); ?>
    
    </div><!-- #comments -->
  8. WP Voyager
    Member
    Posted 4 years ago #

    Please put large chunks of code in the Pastebin as per Forum Rules.

    This code isn't as long as some that I've seen... But still, it's important to keep the forums uncluttered.

    Thanks,
    MindBlender 3D

  9. crypticsage
    Member
    Posted 4 years ago #

    Did you check the language file? I've been able to locate similar changes in there.

  10. Glenn Ansley
    Member
    Posted 4 years ago #

    The Leave a reply text is being generated within the comment_form() function at the bottom of your script. "Leave a reply" is the default value. To change this, you'll need to pass some arguments to the comment_form function.

    $form_args = array( 'title_reply', 'Leave a comment' );
    <?php comment_form( $form_args ); ?>

    There are several other arguments you can override as well. They can be found in wp-includes/comment-template.php. Just search for Leave a Reply. You should find the args somewhere around line 1515

  11. skyeandstone
    Member
    Posted 4 years ago #

    Thank you blepoxp!!!

    That worked great.

    And thanks to all of you for your input.

  12. Glenn Ansley
    Member
    Posted 4 years ago #

    Just in case someone else finds this later, there's a typo in the array in my code. Use standard array syntax: array( 'title_reply' => 'Leave a comment or whatever you want it to say' );

  13. skyeandstone
    Member
    Posted 4 years ago #

    After updating to 3.0, this solution doesn't seem to work anymore. I went back in and made the same changes but no change was reflected to the wp page.

    What am I missing?

  14. e-sushi
    Member
    Posted 4 years ago #

  15. skyeandstone
    Member
    Posted 3 years ago #

    Thanks for the link, looks confusing but informative.

  16. e-sushi
    Member
    Posted 3 years ago #

    So, is this resolved or what?

  17. pancakes4breakfast
    Member
    Posted 3 years ago #

    In WordPress 3.0, it looks to me like the "Leave a Reply" text is generated in line 1171 of comment-template.php, which is in the wp-includes directory. That text seems to be inserted into the h2 tag in line 1527 of the same file.

    In the twentyten theme, all that seems to be called by the comment_form() function in line 77 of the comments.php in the themes directory.

    Hope that helps.

  18. lazyym
    Member
    Posted 3 years ago #

    I've looked in all of the above in twentyten for "says:" where else would I look?

    I want to remove that word from behind the comment title in this post.

    http://valuesboard.com/?p=112

  19. simon.goodchild
    Member
    Posted 3 years ago #

    Doing a search for "says:" I get results in functions.php and comment-template.php if that helps?

  20. lazyym
    Member
    Posted 3 years ago #

    functions, that was it, thanks simon!

  21. lazyym
    Member
    Posted 3 years ago #

    Lost the says, now I can't find the "leave a comment" under the post near edit when logged in, where the heck is that?

    I'v searched for an hour or so....any thoughts?

  22. jlucado
    Member
    Posted 3 years ago #

    I've been all day resolving this myself. Had to learn some stuff along the way.

    You see, I wanted to add some text after the "Leave a Reply" to warn those commenting to use a name and not their website name and be sure to leave a comment that was relevant to the conversation, or their comment would automatically be deleted.

    So I, like most people thought they could just add some php code in their dashboard editor. Problem is, there are no editor templates with those words, "Leave a Reply".

    I purchased the theme from WooThemes. So I headed over to their forum. After about 6 hours of struggling to understand what was being said, someone finally gave me the tip I needed.

    I learned I could not do it in my dashboard editor. You must edit the comments.php file from your server. I used FileZilla, plucked the file, edited it in a text editor and added my text as shown.

      <h2><?php comment_form_title( __('Leave a Reply',woothemes), __('Leave a Reply to %s',woothemes) ); ?></h2> my text.

    Then save this as file named comments.php and re-upload to your server, again using FileZilla.

    I hope this helps and this post is not too long for the moderators.

    Jerry

  23. skyeandstone
    Member
    Posted 3 years ago #

    Editing line 1515 within comment-template.php did work. I'm not sure why it didn't work after the update but it's fine now.

    Thanks for all of the support, you guys are great!

  24. chinmoy
    Member
    Posted 3 years ago #

    @skyeandstone

    don't edit the this file. Change your theme's comment.php file.

    <?php comment_form(array('title_reply' => "REPLY"))?>

  25. shaaarwing
    Member
    Posted 3 years ago #

    wordpress 3.0 .. bottom line of your comment.php file .. you can override a number of presets that appear on the comments form .. for example:

    <?php comment_form(array('title_reply' => "Please leave a comment", 'comment_notes_after' => "")); ?>

    'title_reply' => "Please leave a comment"
    changes 'Leave a Reply' to 'Please leave a comment'

    'comment_notes_after' => ""
    removes the html hints that appear below the comment form

    for all function references see
    http://codex.wordpress.org/Function_Reference/comment_form

  26. HisKingdomProphecy
    Member
    Posted 3 years ago #

    I'm using 2010 Weaver and in the /wp-includes/comment-template.php lines 1542-1545 you will find
    1542 'title_reply' => __( 'Leave a Reply' ),
    1543 'title_reply_to' => __( 'Leave a Reply to %s' ),
    1544 'cancel_reply_link' => __( 'Cancel reply' ),
    1545 'label_submit' => __( 'Post Comment' ),

    I changed 'leave a reply' to please levae a comment' and all works fine.
    Sooo easy. my new line is:
    new 1542 'title_reply' => __( 'Please Leave a Comment' ),

    It took a little searching to find the right php, but less than 1 hour.

  27. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    @HisKingdomProphecy
    and with the next upgrade of wordpress, it is gone again.
    Sooo easy.

    use the method suggested by @shaaarwing, this will stay with the theme, even after wordpress upgrades.

  28. shpoffo
    Member
    Posted 3 years ago #

    I wish we could get @shaaarwing and @HisKingdomProphecy comments made 'sticky' at the top or otherwise highlighted.

    @HisKingdomProphecy dug up the details, and @shaaarwing said how to do it correctly

  29. tiggo
    Member
    Posted 3 years ago #

    I've looked in all of the above in twentyten for "says:" where else resume writers would I look?

    I want to remove that word from behind the comment title in this post.

  30. drumelt
    Member
    Posted 3 years ago #

    The best way to change the wording "Leave a reply" is to use the filter.
    To make it say "Submit a comment:", place this code in your functions.php file:


    function comment_reform ($arg) {
    $arg['title_reply'] = __('Submit a comment:');
    return $arg;
    }
    add_filter('comment_form_defaults','comment_reform');

Topic Closed

This topic has been closed to new replies.

About this Topic