|
| 1 | +<?php |
| 2 | +/* |
| 3 | +The comments page for Bones |
| 4 | +*/ |
| 5 | + |
| 6 | +// Do not delete these lines |
| 7 | + if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) |
| 8 | + die ('Please do not load this page directly. Thanks!'); |
| 9 | + |
| 10 | + if ( post_password_required() ) { ?> |
| 11 | + <div class="help"> |
| 12 | + <p class="nocomments">This post is password protected. Enter the password to view comments.</p> |
| 13 | + </div> |
| 14 | + <?php |
| 15 | + return; |
| 16 | + } |
| 17 | +?> |
| 18 | + |
| 19 | +<!-- You can start editing here. --> |
| 20 | + |
| 21 | +<?php if ( have_comments() ) : ?> |
| 22 | + |
| 23 | + <h3 id="comments" class="h2"><?php comments_number('<span>No</span> Responses', '<span>One</span> Response', '<span>%</span> Responses' );?> to “<?php the_title(); ?>”</h3> |
| 24 | + |
| 25 | + <nav id="comment-nav"> |
| 26 | + <ul class="clear"> |
| 27 | + <li><?php previous_comments_link() ?></li> |
| 28 | + <li><?php next_comments_link() ?></li> |
| 29 | + </ul> |
| 30 | + </nav> |
| 31 | + |
| 32 | + <ol class="commentlist"> |
| 33 | + <?php wp_list_comments('type=comment&callback=bones_comments'); ?> |
| 34 | + </ol> |
| 35 | + |
| 36 | + <nav id="comment-nav"> |
| 37 | + <ul class="clear"> |
| 38 | + <li><?php previous_comments_link() ?></li> |
| 39 | + <li><?php next_comments_link() ?></li> |
| 40 | + </ul> |
| 41 | + </nav> |
| 42 | + |
| 43 | + <?php else : // this is displayed if there are no comments so far ?> |
| 44 | + |
| 45 | + <?php if ( comments_open() ) : ?> |
| 46 | + <!-- If comments are open, but there are no comments. --> |
| 47 | + |
| 48 | + <?php else : // comments are closed ?> |
| 49 | + <!-- If comments are closed. --> |
| 50 | + <p class="nocomments">Comments are closed.</p> |
| 51 | + |
| 52 | + <?php endif; ?> |
| 53 | + |
| 54 | +<?php endif; ?> |
| 55 | + |
| 56 | + |
| 57 | +<?php if ( comments_open() ) : ?> |
| 58 | + |
| 59 | +<section id="respond"> |
| 60 | + |
| 61 | + <h3 id="comment-form-title" class="h2"><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3> |
| 62 | + |
| 63 | + <div id="cancel-comment-reply"> |
| 64 | + <p class="small"><?php cancel_comment_reply_link(); ?></p> |
| 65 | + </div> |
| 66 | + |
| 67 | + <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?> |
| 68 | + <div class="help"> |
| 69 | + <p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p> |
| 70 | + </div> |
| 71 | + <?php else : ?> |
| 72 | + |
| 73 | + <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> |
| 74 | + |
| 75 | + <?php if ( is_user_logged_in() ) : ?> |
| 76 | + |
| 77 | + <p class="comments-logged-in-as">Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out »</a></p> |
| 78 | + |
| 79 | + <?php else : ?> |
| 80 | + |
| 81 | + <ul id="comment-form-elements" class="clear"> |
| 82 | + |
| 83 | + <li> |
| 84 | + <label for="author">Name <?php if ($req) echo "(required)"; ?></label> |
| 85 | + <input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" placeholder="Your Name" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /> |
| 86 | + </li> |
| 87 | + |
| 88 | + <li> |
| 89 | + <label for="email">Mail <?php if ($req) echo "(required)"; ?></label> |
| 90 | + <input type="email" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" placeholder="Your Email" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /> |
| 91 | + <small>(will not be published)</small> |
| 92 | + </li> |
| 93 | + |
| 94 | + <li> |
| 95 | + <label for="url">Website</label> |
| 96 | + <input type="url" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" placeholder="Your Website" tabindex="3" /> |
| 97 | + </li> |
| 98 | + |
| 99 | + </ul> |
| 100 | + |
| 101 | + <?php endif; ?> |
| 102 | + |
| 103 | + <p><textarea name="comment" id="comment" placeholder="Your Comment Here..." tabindex="4"></textarea></p> |
| 104 | + |
| 105 | + <p> |
| 106 | + <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> |
| 107 | + <?php comment_id_fields(); ?> |
| 108 | + </p> |
| 109 | + |
| 110 | + <p id="allowed_tags"><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></p> |
| 111 | + |
| 112 | + <?php do_action('comment_form', $post->ID); ?> |
| 113 | + |
| 114 | + </form> |
| 115 | + |
| 116 | + <?php endif; // If registration required and not logged in ?> |
| 117 | +</section> |
| 118 | + |
| 119 | +<?php endif; // if you delete this the sky will fall on your head ?> |
0 commit comments