Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Change "leave a comment" in twenty ten WordPress

I want to change "leave a comment" to "leave a testimonial" in the twenty ten theme.
Can't find it anywhere I would have thought to look.

So it has "leave a testimonial" on every post instead of "leave a comment".

Thanks

Answers (3)

2011-08-14

Christianto answers:

Hi,

In twentyten directory find comments.php and edit on line 77
<?php comment_form(); ?>
become
<?php
$args = array(
'title_reply' => 'Leave a testimonial'
);
comment_form($args);
?>


Christianto comments:

Did above code work in your site or it didn't?
If it did, regarding another "comment" words in your reply to Jerson, you can use below code..

<?php
$args = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Testimonial', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a testimonial.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'id_form' => 'commentform',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Testiomial' ),
'title_reply_to' => __( 'Leave a Testimonial to %s' ),
'cancel_reply_link' => __( 'Cancel Testimonial' ),
'label_submit' => __( 'Post Testimonial' ),
);
comment_form($args);
?>


Christianto comments:

Sorry clean up code lil'bit

<?php
$args = array(
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Testimonial', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a testimonial.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'title_reply' => __( 'Leave a Testiomial' ),
'title_reply_to' => __( 'Leave a Testimonial to %s' ),
'cancel_reply_link' => __( 'Cancel Testimonial' ),
'label_submit' => __( 'Post Testimonial' ),
);
comment_form($args);
?>

2011-08-14

Kailey Lampert answers:

You can add this to your function.php file, or save to a php file and add to wp-content/mu-plugins

add_filter( 'comment_form_defaults', 'change_reply' );
function change_reply( $defaults ) {
$defaults['title_reply'] = 'Leave a testimonial';
return $defaults;
}


If added to mu-plugins, your changes won't be overwritten on the next theme update.


Graham Kite comments:

Lound it in the loop but will split the prize money as well.
Thanks for the quick response


Graham Kite comments:

Wiil do Prize money later as need to get something finished urgently


Graham Kite comments:

Actually I tested both to check the best option to use.
Neither work :) but the loop edit does.


Kailey Lampert comments:

hmm - that filter is the only running out of my mu-plugins folder, and it works for my site using twentyten. I did have to clear my cache though

2011-08-14

Jerson Baguio answers:

I think this article may help you

[[LINK href="http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/"]]http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/[[/LINK]]

http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/


Graham Kite comments:

Looked at that, but in twenty ten it's all over the place, there are changes that need to be made in loop, functions, comments. It is getting very tedious now.

The last two changes I need are below, will give the prize to whoeve can help me fix these quickly.


Graham Kite comments: