Make WordPress Themes

Ticket #26099: comments.php

File comments.php, 3.2 KB (added by Mckilem, 10 years ago)

Please test with this version, wasn't using filters where needed to.

Line 
1<?php
2/**
3 * The template for displaying comments.
4 *
5 * The area of the page that contains both current comments
6 * and the comment form.
7 *
8 * @package BBird Under
9 */
10
11/*
12 * If the current post is protected by a password and
13 * the visitor has not yet entered the password we will
14 * return early without loading the comments.
15 */
16if ( post_password_required() ) {
17        return;
18}
19?>
20
21<div id="comments" class="comments-area">
22
23    <?php // You can start editing here -- including this comment! ?>
24
25    <?php if ( have_comments()) : ?>
26   
27   
28    <h2 class="comments-title">
29       
30    <h3>
31        <?php
32printf( _nx( 'One Comment', '%1$s Comments', get_comments_number(), 'comments title', 'bbird-under' ), number_format_i18n( get_comments_number() ) );
33 ?>
34</h3>
35       
36    </h2>
37 
38
39    <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // are there comments to navigate through  ?>
40        <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
41            <h2 class="screen-reader-text"><?php _e('Comment navigation', 'bbird-under'); ?></h2>
42            <div class="nav-links">
43
44                <div class="nav-previous"><?php previous_comments_link(__('Older Comments', 'bbird-under')); ?></div>
45                <div class="nav-next"><?php next_comments_link(__('Newer Comments', 'bbird-under')); ?></div>
46
47            </div><!-- .nav-links -->
48        </nav><!-- #comment-nav-above -->
49    <?php endif; // check for comment navigation  ?>
50
51    <ol class="comment-list">
52       
53     <?php   
54        wp_list_comments( array(
55    'callback' => 'bbird_under_comments',
56    'avatar_size'       => 120,           
57) );
58     ?> 
59
60     
61    </ol><!-- .comment-list -->
62
63    <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // are there comments to navigate through  ?>
64        <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
65            <h2 class="screen-reader-text"><?php _e('Comment navigation', 'bbird-under'); ?></h2>
66            <div class="nav-links">
67
68                <div class="nav-previous"><?php previous_comments_link(__('Older Comments', 'bbird-under')); ?></div>
69                <div class="nav-next"><?php next_comments_link(__('Newer Comments', 'bbird-under')); ?></div>
70
71            </div><!-- .nav-links -->
72        </nav><!-- #comment-nav-below -->
73    <?php endif; // check for comment navigation  ?>
74
75    <?php endif; // have_comments()  ?>
76
77    <?php
78    // If comments are closed and there are comments, let's leave a little note, shall we?
79    if (!comments_open() && '0' != get_comments_number() && post_type_supports(get_post_type(), 'comments')) :
80        ?>
81        <p class="no-comments"><?php _e('Comments are closed.', 'bbird-under'); ?></p>
82    <?php endif; ?>
83
84   
85    <?php
86
87comment_form(array(   
88 
89    'label_submit' => __('Post my Comment', 'bbird-under'),
90    'title_reply' => __('Have something to say?', 'bbird-under'),
91    'title_reply_to' => __('Respond to %s', 'bbird-under'),
92    'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __('(No worries, we will keep your email safe! Also, make sure you fill in email and name fields before posting a comment.)', 'bbird-under') . '</span></p>'
93));
94?>
95
96</div><!-- #comments -->