root/headlines-new-theme/comments.php

Revision 42, 3.5 kB (checked in by drakewils..@gmail.com, 2 months ago)

moved comment form to the top

Line 
1 <?php // Do not delete these lines
2     if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
3         die ('Please do not load this page directly. Thanks!');
4
5     if (!empty($post->post_password)) { // if there's a password
6         if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
7             ?>
8
9             <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
10
11             <?php
12             return;
13         }
14     }
15
16     /* This variable is for alternating comment background */
17     $oddcomment = 'class="alt" ';
18 ?>
19
20 <!-- You can start editing here. -->
21
22 <?php if ('open' == $post->comment_status) : ?>
23
24 <h3 id="respond">Leave a Reply</h3>
25
26 <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
27 <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
28 <?php else : ?>
29
30 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
31
32 <?php if ( $user_ID ) : ?>
33
34 <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
35
36 <?php else : ?>
37
38 <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
39 <label for="author">Name (required)</label></p>
40
41 <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
42 <label for="email">Mail (never for spam)</label></p>
43
44 <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
45 <label for="url">Website (optional)</label></p>
46
47 <?php endif; ?>
48
49 <!--<p><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></p>-->
50
51 <p><textarea name="comment" id="comment" cols="60" rows="10" tabindex="4"></textarea></p>
52
53 <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" class="button" />
54 <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
55 </p>
56 <?php do_action('comment_form', $post->ID); ?>
57
58 </form>
59
60 <?php endif; // If registration required and not logged in ?>
61
62
63 <?php if ($comments) : ?>
64     <h3>Comments</h3>
65
66     <ol class="commentlist">
67
68     <?php foreach ($comments as $comment) : ?>
69
70         <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
71            
72             <div class="comment-bubble">
73                 <?php if ($comment->comment_approved == '0') : ?>
74                     <p>Your comment is awaiting moderation.</p>
75                 <?php endif; ?>
76    
77                 <?php comment_text() ?>
78             </div>
79            
80             <img src="/wp-content/themes/headlines-new-theme/images/bubbletip.png" alt="" style="margin-top: -10px;" />
81            
82             <?php comment_author_link() ?>
83            
84             on <?php comment_date('F jS, Y') ?> at <?php comment_time() ?>
85            
86         </li>
87
88     <?php
89         /* Changes every other comment to a different class */
90         $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
91     ?>
92
93     <?php endforeach; /* end for each comment */ ?>
94
95     </ol>
96
97  <?php else : // this is displayed if there are no comments so far ?>
98
99     <?php if ('open' == $post->comment_status) : ?>
100         <!-- If comments are open, but there are no comments. -->
101
102      <?php else : // comments are closed ?>
103         <!-- If comments are closed. -->
104         <p>Comments are closed.</p>
105
106     <?php endif; ?>
107 <?php endif; ?>
108
109
110
111
112 <?php endif; // if you delete this the sky will fall on your head ?>
113
Note: See TracBrowser for help on using the browser.