comments.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /*
  3. The comments page for Bones
  4. */
  5. // Do not delete these lines
  6. if ( ! empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) )
  7. die ('Please do not load this page directly. Thanks!');
  8. if ( post_password_required() ) { ?>
  9. <div class="alert alert-help">
  10. <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'bonestheme' ); ?></p>
  11. </div>
  12. <?php
  13. return;
  14. }
  15. ?>
  16. <?php // You can start editing here. ?>
  17. <?php if ( have_comments() ) : ?>
  18. <h3 id="comments" class="h2"><?php comments_number( __( '<span>No</span> Responses', 'bonestheme' ), __( '<span>One</span> Response', 'bonestheme' ), _n( '<span>%</span> Response', '<span>%</span> Responses', get_comments_number(), 'bonestheme' ) );?> to &#8220;<?php the_title(); ?>&#8221;</h3>
  19. <nav id="comment-nav">
  20. <ul class="clearfix">
  21. <li><?php previous_comments_link() ?></li>
  22. <li><?php next_comments_link() ?></li>
  23. </ul>
  24. </nav>
  25. <ol class="commentlist">
  26. <?php wp_list_comments( 'type=comment&callback=bones_comments' ); ?>
  27. </ol>
  28. <nav id="comment-nav">
  29. <ul class="clearfix">
  30. <li><?php previous_comments_link() ?></li>
  31. <li><?php next_comments_link() ?></li>
  32. </ul>
  33. </nav>
  34. <?php else : // this is displayed if there are no comments so far ?>
  35. <?php if ( comments_open() ) : ?>
  36. <?php // If comments are open, but there are no comments. ?>
  37. <?php else : // comments are closed ?>
  38. <?php // If comments are closed. ?>
  39. <!--p class="nocomments"><?php _e( 'Comments are closed.', 'bonestheme' ); ?></p-->
  40. <?php endif; ?>
  41. <?php endif; ?>
  42. <?php if ( comments_open() ) : ?>
  43. <section id="respond" class="respond-form">
  44. <h3 id="comment-form-title" class="h2"><?php comment_form_title( __( 'Leave a Reply', 'bonestheme' ), __( 'Leave a Reply to %s', 'bonestheme' )); ?></h3>
  45. <div id="cancel-comment-reply">
  46. <p class="small"><?php cancel_comment_reply_link(); ?></p>
  47. </div>
  48. <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
  49. <div class="alert alert-help">
  50. <p><?php printf( __( 'You must be %1$slogged in%2$s to post a comment.', 'bonestheme' ), '<a href="<?php echo wp_login_url( get_permalink() ); ?>">', '</a>' ); ?></p>
  51. </div>
  52. <?php else : ?>
  53. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  54. <?php if ( is_user_logged_in() ) : ?>
  55. <p class="comments-logged-in-as"><?php _e( 'Logged in as', 'bonestheme' ); ?> <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="<?php _e( 'Log out of this account', 'bonestheme' ); ?>"><?php _e( 'Log out', 'bonestheme' ); ?> <?php _e( '&raquo;', 'bonestheme' ); ?></a></p>
  56. <?php else : ?>
  57. <ul id="comment-form-elements" class="clearfix">
  58. <li>
  59. <label for="author"><?php _e( 'Name', 'bonestheme' ); ?> <?php if ($req) _e( '(required)'); ?></label>
  60. <input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" placeholder="<?php _e( 'Your Name*', 'bonestheme' ); ?>" <?php if ($req) echo "aria-required='true'"; ?> />
  61. </li>
  62. <li>
  63. <label for="email"><?php _e( 'Mail', 'bonestheme' ); ?> <?php if ($req) _e( '(required)'); ?></label>
  64. <input type="email" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" placeholder="<?php _e( 'Your E-Mail*', 'bonestheme' ); ?>" <?php if ($req) echo "aria-required='true'"; ?> />
  65. <small><?php _e("(will not be published)", 'bonestheme' ); ?></small>
  66. </li>
  67. <li>
  68. <label for="url"><?php _e( 'Website', 'bonestheme' ); ?></label>
  69. <input type="url" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" placeholder="<?php _e( 'Got a website?', 'bonestheme' ); ?>" />
  70. </li>
  71. </ul>
  72. <?php endif; ?>
  73. <p><textarea name="comment" id="comment" placeholder="<?php _e( 'Your Comment here...', 'bonestheme' ); ?>"></textarea></p>
  74. <p>
  75. <input name="submit" type="submit" id="submit" class="button" value="<?php _e( 'Submit', 'bonestheme' ); ?>" />
  76. <?php comment_id_fields(); ?>
  77. </p>
  78. <div class="alert alert-info">
  79. <p id="allowed_tags" class="small"><strong>XHTML:</strong> <?php _e( 'You can use these tags', 'bonestheme' ); ?>: <code><?php echo allowed_tags(); ?></code></p>
  80. </div>
  81. <?php do_action( 'comment_form', $post->ID ); ?>
  82. </form>
  83. <?php endif; // If registration required and not logged in ?>
  84. </section>
  85. <?php endif; // if you delete this the sky will fall on your head ?>