logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$4
Change "leave a comment" in twenty ten

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

Graham Kite | 08/14/11 at 10:00pm Edit
Tutorial: How to assign prize money


(3) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    08/14/11
    10:14pm
    Christianto says:

    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);
    ?>

    • 08/15/11 12:56am

      Christianto says:

      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);
      ?>

    • 08/15/11 12:58am

      Christianto says:

      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);
      ?>

  • avatar
    Last edited:
    08/14/11
    10:17pm
    Kailey Lampert says:

    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.

    • 08/14/11 10:19pm

      Graham Kite says:

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

    • 08/14/11 10:20pm

      Graham Kite says:

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

    • 08/14/11 10:26pm

      Graham Kite says:

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

    • 08/14/11 10:32pm

      Kailey Lampert says:

      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

  • avatar
    Last edited:
    08/14/11
    10:23pm
    Jerson Baguio says:

    I think this article may help you

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

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

    • 08/14/11 11:33pm

      Graham Kite says:

      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.

    • 08/14/11 11:34pm

      Graham Kite says:

      Attached Image

    • 08/17/11 2:00am

      Jerson Baguio says:

      Add this code to your functions.php or simply replace if you have the same function with same functionality.


      function comment_reform ($arg) {
      $arg['title_reply'] = __('Leave Testimonial');
      $arg['label_submit'] = __('Post Testimonial');
      $arg['comment_field'] = __('Testimonial');
      return $arg;
      }
      add_filter('comment_form_defaults','comment_reform');



      Or add the argument array that will replace the Comment and Post Comments text



This question has expired.





Current status of this question: Community pot



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.