Custom comment form in WordPress

navyman

New Member
I would like to customize the output of \[code\]comment_form()\[/code\] function in WordPress.To edit fields and textarea, I used the following code and all works fine.\[code\]<?php $req = get_option( 'require_name_email' ); $fields = array( // redefine author field 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name:' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label>' . '<div class="input-prepend"><span class="add-on"><i class="icon-user"></i></span><input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . 'aria-required="true"' . ' required /></p>', 'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email Address:' ) . ( $req ? ' <span class="required">*</span><br/>' : '' ) . '</label>' . '<div class="input-prepend"><span class="add-on"><i class="icon-envelope"></i></span><input required id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . 'aria-required="true"' . ' required /></div></p>', 'url' => '<p class="comment-form-url"><label for="url">' . __( 'Your Website:' ) . '</label>' . '<div class="input-prepend"><span class="add-on"><i class="icon-globe"></i></span><input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></div></p>' ); $comments_args = array( 'fields' => $fields, // redefine your own textarea (the comment body) 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . 'Comment' . '</label><textarea id="comment" name="comment" class="span12" rows="5" aria-required="true"></textarea></p>', ); comment_form( $comments_args );?>\[/code\]This is the result:
td2mE.png
Now, I would like to add two CSS class (\[code\]class="btn btn-primary"\[/code\]) for submit button; how can I do that without using jQuery?
 
Back
Top