$comment_args = array( 'title_reply'=>'',
'fields' => apply_filters( 'comment_form_default_fields', array(
'author' =>'<p class="comment-form-author">' . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />'
. '<label for="author">' . __( 'Name *' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label></p>',
'email' => '<p class="comment-form-email">' . '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" aria-describedby="email-notes"' . $aria_req . ' />'
. '<label for="email">' . __( 'Email *' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label></p>',
'phone' => '<p class="comment-form-phone">'.
'<label for="phone">' . __( 'Phone' ) . '</label>'.
'<input id="phone" name="phone" type="text" size="30" tabindex="4" /></p>';
'url' => '<p class="comment-form-url">' . '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />'
. '<label for="url">' . __( 'Website' ) . '</label></p>',
) ),
'comment_field' => '<p>' .
'<label for="comment">' . __( 'Comment' ) . '</label>' .
'<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>' .
'</p>',
'comment_notes_before' => '',
'comment_notes_after' => '',
'title_reply' =>'',
);
comment_form($comment_args);
Wordpress Knowledge
How To Add Custom Fields In A WordPress Comment Form
July 24, 2018
How To Add Custom Fields In A WordPress Comment Form By default comment_form function generates your comment form with three text fields (Name, Email, and Website), a textarea field for the comment text, and the submit button. here we add phone custom field in comment form Example :
if you need to change comment form fields Only customise according to you Like button name,title use below code Read more…