comments.php (3711B)
1 <?php 2 /** 3 * The template for displaying comments 4 * 5 * This is the template that displays the area of the page that contains both the current comments 6 * and the comment form. 7 * 8 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ 9 * 10 * @package Appside 11 */ 12 13 /* 14 * If the current post is protected by a password and 15 * the visitor has not yet entered the password we will 16 * return early without loading the comments. 17 */ 18 if ( post_password_required() ) { 19 return; 20 } 21 ?> 22 23 <div id="comments" class="comments-area"> 24 25 <?php 26 // You can start editing here -- including this comment! 27 if ( have_comments() ) : 28 ?> 29 <h2 class="comments-title"> 30 <?php 31 $appside_comment_count = get_comments_number(); 32 if ( '1' === $appside_comment_count ) { 33 printf( 34 /* translators: 1: title. */ 35 esc_html__( '1 Comment', 'aapside' ) 36 37 ); 38 } else { 39 printf( // WPCS: XSS OK. 40 /* translators: 1: comment count number, 2: title. */ 41 esc_html( _nx( '%1$s Comments “%2$s”', '%1$s Comments ', $appside_comment_count, 'comments title', 'aapside' ) ), 42 number_format_i18n( $appside_comment_count ) 43 ); 44 } 45 ?> 46 </h2><!-- .comments-title --> 47 48 <div class="blog-comment-navigation"> 49 <?php the_comments_navigation(); ?> 50 </div> 51 <div class="clearfix"></div> 52 <ul class="comment-list"> 53 <?php 54 wp_list_comments( array( 55 'style' => 'ul', 56 'callback' => 'appside_comment_modification', 57 'short_ping' => true, 58 ) ); 59 ?> 60 </ul><!-- .comment-list --> 61 <div class="blog-comment-navigation"> 62 <?php the_comments_navigation(); ?> 63 </div> 64 <?php 65 // If comments are closed and there are comments, let's leave a little note, shall we? 66 if ( ! comments_open() ) : 67 ?> 68 <p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'aapside' ); ?></p> 69 <?php 70 endif; 71 72 endif; // Check for have_comments(). 73 $fields = array( 74 'author' => ' <div class="form-group"> 75 <input type="text" id="author" name="author" tabindex="1" value="' . esc_attr( $commenter['comment_author'] ) . '" class="form-control" placeholder="'.esc_attr__('Name...','aapside').'"> 76 </div>', 77 'email' => ' <div class="form-group"> 78 <input type="email" class="form-control" name="email" id="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" tabindex="2" placeholder="'.esc_attr__('Email...','aapside').'"> 79 </div>', 80 'URL' => '<div class="form-group"> 81 <input type="text" id="url" name="url" value="' . esc_url( $commenter['comment_author_url'] ) . '" class="form-control" tabindex="3" placeholder="'.esc_attr__('Subject...','aapside').'"> 82 </div>' 83 ); 84 comment_form( array( 85 'fields' => apply_filters( 'comment_form_default_fields', $fields ), 86 'comment_notes_before' => '', 87 'comment_notes_after' => '', 88 'title_reply' => esc_html__( 'Leave A Comment', 'aapside' ), 89 'title_reply_to' => esc_html__( 'Leave A Reply To %s', 'aapside' ), 90 'id_form' => 'commentform', 91 'id_submit' => 'submit', 92 'cancel_reply_link' => '<i class="fa fa-times"></i>', 93 'class_submit' => 'submit-btn', 94 'label_submit' => esc_html__( 'Submit Comment', 'aapside' ), 95 'comment_field' => '<div class="form-group textarea"> 96 <textarea name="comment" id="comment" class="form-control" placeholder="' . esc_attr__( 'Comment...', 'aapside' ) . '" cols="30" rows="10"></textarea> 97 </div>' 98 ) ); 99 ?> 100 101 </div><!-- #comments -->