The comment form is output by the WordPress comment_form() function. To add a CSS class to specific inputs, you can change the $fields
argument when it's called from the bottom of the TwentyTen comments.php file.
In the example below I've added class="text"
to the author input field:
<?php
$fields = array(
'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '<input class="text" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label>' . '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
);
comment_form(array('fields'=>$fields));
?>
Alternatively you could create a filter in your theme's functions.php that added the input class for you:
function my_comment_fields($fields) {
foreach($fields as $field){
// Add the class to your field's input
}
return $fields;
}
add_filter('comment_form_default_fields','my_comment_fields');