サポート » 使い方全般 » コメント(comments.php)のカスタマイズについて

  • 先週WordPressを始めた初心者です。
    テーマは自分で作ってまして、そのデザインに合わせてコメントもカスタマイズしたいと思い、色々調べたのですが、設定が反映されない状況です。
    コメントはsingle.phpに<?php comments_template(); ?>として、
    comments.phpには

    <div class="comments">
    <?php $args = array(
        'fields'                => $fields,
        'comment_field'         => $comment_field,
        'must_log_in'           => $must_log_in,
        'logged_in_as'          => $logged_in_as,
        'comment_notes_before'  => $comment_notes_before,
        'comment_notes_after'   => $comment_notes_after,
        'id_form'               => $id_form,
        'id_submit'             => $id_submit,
        'title_reply'           => $title_reply,
        'title_reply_to'        => $title_reply_to,
        'cancel_reply_link'     => $cancel_reply_link,
        'label_submit'          => $label_submit
        );
    //valueのデフォルト値用
    $commenter = wp_get_current_commenter(); 
    
    $fields = array(
        'author' => '<p id="inputtext">' . '<label for="author">Name</label> '
                    . ( $req ? '<span class="required">*</span>' : '' )  .
                    '<br /><input id="author" name="author" type="text" value="'
                    . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
        'email'  => '<p id="inputtext"><label for="email">' . __( 'Email' ) . '</label> '
                    . ( $req ? '<span class="required">*</span>' : '' ) .
                    '<br /><input id="email" name="email" type="text" value="'
                    . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
        'url'    => '<p id="inputtext"><label for="url">' . __( 'Website' ) . '</label>' .
                    '<br /><input id="url" name="url" type="text" value="'
                    . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
                    );
    //配列を設定し終わったらフィルター通す
    $fields = apply_filters( 'comment_form_default_fields', $fields );
    $req = get_option( 'require_name_email' );
    $aria_req = ( $req ? " aria-required='true'" : '' );
    
    $comment_field = '<p id="textarea"><label for="comment">' . 'Comment' . '</label><br />
                   . <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>'; 
    
    $comment_notes_before = '';
    $comment_notes_after = '';
    $title_reply = '';
    $id_form = 'commentform';
    $title_reply = '';
    $title_reply_to = __( 'Leave a Reply to %s' );
    $cancel_reply_link = 'Cancel';
    $label_submit = 'Submit Comment';
    
    comment_form( $args ); ?>
    
    </div>

    としました。
    PHPも今回初めてなので、見よう見まねです。

    色々変更してみたりしたのですが、反映しません。
    乏しい表現で申し訳ありませんが、教えて下さい!!
    よろしくお願い致します。

  • トピック「コメント(comments.php)のカスタマイズについて」には新たに返信することはできません。