Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
97 lines (85 loc) · 3.4 KB
/
Copy pathcomments.php
File metadata and controls
97 lines (85 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/**
* Template part file the contains the Comments functionality
*
* This template file includes both the comments list and
*
* @link http://codex.wordpress.org/Function_Reference/comments_number Codex reference: comments_number()
* @link http://codex.wordpress.org/Function_Reference/the_title Codex reference: the_title()
* @link http://codex.wordpress.org/Function_Reference/get_comments_pages_count Codex reference: get_comment_pages_count()
* @link http://codex.wordpress.org/Function_Reference/get_option Codex reference: get_option()
* @link http://codex.wordpress.org/Function_Reference/paginate_comments_links Codex reference: paginate_comments_links()
* @link http://codex.wordpress.org/Function_Reference/wp_list_comments Codex reference: wp_list_comments()
* @link http://codex.wordpress.org/Function_Reference/comment_form Codex reference: comment_form()
*
* @uses oenology_hook_post_comments_after() Defined in /functions/hooks.php
* @uses oenology_hook_post_comments_before()() Defined in /functions/hooks.php
*
* @package Oenology
* @copyright Copyright (c) 2010, Chip Bennett
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
*
* @since Oenology 1.0
*/
?>
<!-- Comments Begin (div#comments) -->
<div id="comments">
<?php oenology_hook_post_comments_before(); ?>
<?php
if (
// If there are comments, output them.
have_comments()
) {
?>
<h2 class="commentsheader">Feedback</h2>
<?php
// Globalize variable that holds comments by type.
global $comments_by_type;
?>
<h3>Comments <?php if ( ! comments_open() ) { ?> <small>(Comments are closed)</small><?php } ?></h3>
<?php $i = 0; ?>
<span id="comments-responses" style="font-weight:bold;"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</span>
<?php
// If the paged comments setting is enabled, and enough comments exisst to cause comments to be paged.
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) {
?>
<div class="nav-comments">
<?php paginate_comments_links( array( 'prev_text' => '<<', 'next_text' => '>>' ) ); ?>
</div> <!-- .navigation -->
<?php
} // check for comment navigation
if ( get_comments_number() > '0' ) {
?>
<ol class="commentlist">
<?php wp_list_comments( 'type=comment&avatar_size=40' ); ?>
</ol>
<?php
}
// Are there comments to navigate through?
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) {
?>
<div class="nav-comments">
<?php paginate_comments_links( array( 'prev_text' => '<<', 'next_text' => '>>' ) ); ?>
</div>
<?php
} // check for comment navigation
// If the post has any trackbacks or pingbacks, display them as a list.
global $comments_by_type;
$comments_by_type = &separate_comments( $comments );
if ( ! empty( $comments_by_type['pings'] ) ) {
?>
<h3 class='trackbackheader'>Trackbacks</h3>
<ol class="trackbacklist">
<?php wp_list_comments( array( 'type' => 'pings', 'callback' => 'oenology_comment_list_pings' ) ); ?>
</ol>
<?php
}
} else {
// Or, if we don't have comments, don't do anything.
}
// End of have_comments() conditional output. Output the comment form.
comment_form();
oenology_hook_post_comments_after();
?>
</div>
<!-- Comments End (div#comments) -->