Created
June 20, 2018 12:29
-
-
Save AbmSourav/19e451cffa335bcbcab81fb161eed7f3 to your computer and use it in GitHub Desktop.
WordPress Comments Fields with Bootstrap classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="col-md-8 comment-form"> | |
<?php | |
$fields = array( | |
'author' => | |
'<div class="form-group"><label for="author">' . __( 'Name', 'domainreference' ) . '</label> <span class="required">*</span> <input id="author" name="author" type="text" class="form-control" value="' . esc_attr( $commenter['comment_author'] ) . '" required="required" /></div>', | |
'email' => | |
'<div class="form-group"><label for="email">' . __( 'Email', 'domainreference' ) . '</label> <span class="required">*</span><input id="email" name="email" class="form-control" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" required="required" /></div>', | |
'url' => | |
'<div class="form-group last-field"><label for="url">' . __( 'Website', 'domainreference' ) . '</label><input id="url" name="url" class="form-control" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" /></div>' | |
); | |
$args = array( | |
'class_submit' => 'btn btn-block btn-lg btn-info', | |
'label_submit' => __( 'Submit Comment' ), | |
'comment_field' => | |
'<div class="form-group"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <span class="required">*</span><textarea id="comment" class="form-control" name="comment" rows="2" required="required"></textarea></div>', | |
'fields' => apply_filters( 'comment_form_default_fields', $fields ) | |
); | |
comment_form( $args ); | |
?> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nicely done. Thank you.