How can I change the text on “post comment” button?

I am building a site for some therapists using wordpress and am using the comment section of a post for a question and answer with the therapists. However I cannot find where the text is coming from on the “post comment” button. I would like to change it to “Post a Question”.

The comments.php in the theme has nothing about it and I cannot find it anywhere in the main wp-comments-post.php

Read More

Any help would be great!

Thanks

The web address is http://s416809079.onlinehome.us/ask-the-therapist/

Edit: My confusion has been that I cannot find the ‘post comment’ anywhere. Also if I just add it then there becomes two buttons and the new one does not actually submit. Here is the code.

<?php
/**
 * Comments Template
 *
 * @file           comments.php
 * @package        Pilot Fish
 * @filesource     wp-content/themes/pilot-fish/comments.php
 * @since          Pilot Fish 0.1
 */
if ( post_password_required() ) : ?>
<p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'pilotfish' ); ?></p>
<?php /* Stop the rest of comments.php from being processed */
        return;
endif; ?>

<?php if (have_comments()) : ?>
<h6 id="comments"><?php comments_number(__('No Response to', 'pilotfish'), __('One Response to', 'pilotfish'), __('% Responses to', 'pilotfish')); ?> <i><?php the_title(); ?></i></h6>

<ol class="commentlist">
    <?php wp_list_comments('avatar_size=60'); ?> 
</ol>

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
<nav class="pager">
    <div class="previous"><?php previous_comments_link(__( '‹ previous','pilotfish' )); ?></div><!-- end of .previous -->
    <div class="next"><?php next_comments_link(__( 'next ›','pilotfish', 0 )); ?></div><!-- end of .next -->
</nav><!-- end of.pager -->
<?php endif; ?>

<?php else : ?>
<?php if (comments_open()) : ?>

<?php
$fields = array(
    'author' => '<p id="comment-form-author">' . '<label for="author">' .     __('Name','pilotfish') . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
    '<input id="author" name="author" placeholder="'. __('name (required)', 'pilotfish').'" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30" /></p>',
    'email' => '<p id="comment-form-email"><label for="email">' . __('E-mail','pilotfish') . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
    '<input id="email" name="email" placeholder="'. __('email (required)', 'pilotfish').'" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" /></p>',
    'url' => '<p id="comment-form-url"><label for="url">' . __('Website','pilotfish') . '</label>' .
    '<input id="url" name="url" placeholder="'. __('website', 'pilotfish').'" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p>',
);
$defaults = array('fields' => apply_filters('comment_form_default_fields', $fields));
comment_form($defaults);


?>
<?php endif; ?>

Related posts

Leave a Reply

6 comments

  1. The Comment Form Codex has everything you need to know about customizing the values of a Comment form.

    $defaults = array(
        'fields' => apply_filters('comment_form_default_fields', $fields),
        'label_submit' => __('Post a Question')
    );
    comment_form($defaults);
    

    That should do what you need.

  2. Avoid editing your theme’s files directly as your changes can be overwritten when you update your theme.

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

    I have added a priority of 11 as the default is 10 and your theme may be changing it with the default priority.

    The Comment Form Codex has everything you need to know about customising the values of a Comment form.

  3. just search for the text post comment and change the value of the button tag for it,

       <input name="submit" type="submit" id="submit" value="Post a Question">
    
  4. Change the value attribute for the following input element:

    <input type="submit" value="Post a Question" id="submit" name="submit">
    

    If you do a search all files for “Post Comment” you should find what you are looking for.

  5. Under the class form-submit change the value.

    Previous

    ...
    <p class="form-submit">
    <input id="submit" type="submit" value="Post Comment" name="submit">
    ...
    

    Change to

    ...
    <p class="form-submit">
    <input id="submit" type="submit" value="Post A Question" name="submit">
    ...