Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
83 lines (67 loc) · 2.57 KB
/
Copy pathcomments.php
File metadata and controls
83 lines (67 loc) · 2.57 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
<?php
$countComments = 0;
$countPings = 0;
if($post->comment_count > 0) {
$comments_list = array();
$pings_list = array();
foreach($comments as $comment) {
if('comment' == get_comment_type()) $comments_list[++$countComments] = $comment;
else $pings_list[++$countPings] = $comment;
}
}
$fields = array(
'author' => '<p><input type="text" name="author" id="author" value="" size="22" tabindex="1" aria-required="true" /><label for="author"><small> Nombre</small></label></p>',
'email' => '<p><input type="text" name="email" id="email" size="22" tabindex="2" aria-required="true" /><label for="email"><small> Correo-e (no se mostrará)</small></label></p>',
'url' => '<p><input type="text" name="url" id="url" size="22" tabindex="3" /><label for="url"><small> Página web</small></label></p>'
);
$fargs = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_notes_after' => '',
'comment_notes_before' => '',
'cancel_reply_link' => __( '<br /><small>Cancel reply</small>' ),
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>'
);
$largs = array(
'style' => 'ol',
'avatar_size' => 42,
'reply_text' => '<small>Reply</small>',
'type' => 'comment'
);
if ( have_comments() ) : ?>
<div id="commentbox">
<h3 id="comments"><?php comments_number('Sin comentarios', 'Un comentario', '% Comentarios' );?></h3>
<ol class="commentlist"><?php wp_list_comments($largs); ?></ol>
<div class="navigation page-link commentpage">
<?php $args = array(
'prev_text' => __('Previous'),
'next_text' => __('Next')
); ?>
<?php paginate_comments_links( $args ) ?>
</div>
</div>
<?php
comment_form($fargs); ?>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ( comments_open() ) : ?>
<div id="commentbox">
<p>Aún no hay comentarios, se el primero en escribir uno.</p>
<?php
comment_form($fargs);// If comments are open, but there are no comments.
?> </div><?php
else : // comments are closed
endif;
endif;?>
<?php if ($countPings > 0) { ?>
<h3>Pingbacks & Trackbacks</h3>
<ol id="pinglist">
<?php foreach($pings_list as $comment) :
if('pingback' == get_comment_type()) $pingtype = 'Pingback';
else $pingtype = 'Trackback';
?>
<li id="comment-<?php echo $comment->comment_ID ?>">
<?php comment_author_link(); ?> - <?php echo $pingtype; ?> on <?php echo mysql2date('Y/m/d', $comment->comment_date); ?>
</li>
<?php endforeach; ?>
</ol>
<?php
} ?>