Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // modify comment form fields
- add_filter( 'comment_form_default_fields', 'salospa_bootstrap3_comment_form_fields' );
- function salospa_bootstrap3_comment_form_fields( $fields ) {
- $commenter = wp_get_current_commenter();
- $req = get_option( 'require_name_email' );
- $aria_req = ( $req ? " aria-required='true'" : '' );
- $html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0;
- $fields = array(
- 'warp-start'=> '<div class="row">',
- 'author' => '<div class="col-md-6"><div class="form-group comment-form-author">' . '<label for="author">' . __( 'Name', 'salospa' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .'<input class="form-control" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></div></div>',
- 'email' => '<div class="col-md-6"><div class="form-group comment-form-email"><label for="email">' . __( 'Email', 'salospa' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .'<input class="form-control" id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></div></div>',
- 'url' => '<div class="col-md-12"><div class="form-group comment-form-url"><label for="url">' . __( 'Website', 'salospa' ) . '</label> ' .'<input class="form-control" id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></div></div>',
- );
- return $fields;
- }
- // modify the comment form
- add_filter( 'comment_form_defaults', 'salospa_bootstrap3_comment_form' );
- function salospa_bootstrap3_comment_form( $args ) {
- $args['comment_field'] = '<div class="col-md-12"><div class="form-group comment-form-comment"><label for="comment">' . __( 'Comment', 'salospa' ) . '</label> <textarea class="form-control" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></div></div>';
- $args['comment_notes_after'] = '<div class="col-md-12"><p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p></div>';
- return $args;
- }
- add_action('comment_form', 'salospa_bootstrap3_comment_button' );
- function salospa_bootstrap3_comment_button() {
- echo '<div class="col-md-12 column"><button class="btn btn-lg ar_btn_md ar_tarn" type="submit"><i class="fa fa-comments-o"></i>' . __( 'Submit', 'salospa' ) . '</button></div></div>';
- }
- /************* COMMENT LAYOUT *********************/
- // Comment Layout
- function salospa_comments( $comment, $args, $depth ) {
- $GLOBALS['comment'] = $comment; ?>
- <li <?php comment_class(); ?>>
- <article id="comment-<?php comment_ID(); ?>" class="clearfix comment-container">
- <div class="media">
- <div class="author-thumb media-left">
- <?php $bgauthemail = get_comment_author_email();?>
- <?php echo get_avatar( $comment, 50 ); ?>
- </div>
- <div class="comment-content media-body">
- <div class="comment-meta">
- <?php printf(__( '<cite class="fn">%s</cite>', 'salospa' ), get_comment_author_link()) ?> <?php _e( '<span class="says">says:</span>','salospa' );?>
- <time datetime="<?php echo comment_time('Y-m-j'); ?>"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php comment_time(__( 'F jS, Y', 'salospa' )); ?> </a></time>
- </div><!-- comment-meta -->
- <?php edit_comment_link(__( '(Edit)', 'salospa' ),' ','') ?>
- <?php if ($comment->comment_approved == '0') : ?>
- <div class="alert alert-info">
- <p><?php _e( 'Your comment is awaiting moderation.', 'salospa' ) ?></p>
- </div>
- <?php endif; ?>
- <section class="comment_content clearfix">
- <?php comment_text() ?>
- </section>
- </div> <!-- END comment-content -->
- </div><!-- media -->
- <div class="reply"><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div><!-- reply comment-reply-link btn ar_btn_md ar_tarn -->
- </article>
- <?php // </li> is added by WordPress automatically ?>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement