comments.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php if ( post_password_required() )
  2. return;
  3. ?>
  4. <?php if ( have_comments() ) : ?>
  5. <div class="comments">
  6. <a name="comments"></a>
  7. <h2 class="comments-title">
  8. <?php echo count($wp_query->comments_by_type['comment']) . ' ';
  9. echo _n( 'Comment' , 'Comments' , count($wp_query->comments_by_type['comment']), 'hemingway' ); ?>
  10. </h2>
  11. <ol class="commentlist">
  12. <?php wp_list_comments( array( 'type' => 'comment', 'callback' => 'hemingway_comment' ) ); ?>
  13. </ol>
  14. <?php if (!empty($comments_by_type['pings'])) : ?>
  15. <div class="pingbacks">
  16. <div class="pingbacks-inner">
  17. <h3 class="pingbacks-title">
  18. <?php echo count($wp_query->comments_by_type['pings']) . ' ';
  19. echo _n( 'Pingback', 'Pingbacks', count($wp_query->comments_by_type['pings']), 'hemingway' ); ?>
  20. </h3>
  21. <ol class="pingbacklist">
  22. <?php wp_list_comments( array( 'type' => 'pings', 'callback' => 'hemingway_comment' ) ); ?>
  23. </ol>
  24. </div>
  25. </div>
  26. <?php endif; ?>
  27. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
  28. <div class="comment-nav-below" role="navigation">
  29. <div class="post-nav-older"><?php previous_comments_link( __( '&laquo; Older<span> Comments</span>', 'hemingway' ) ); ?></div>
  30. <div class="post-nav-newer"><?php next_comments_link( __( 'Newer<span> Comments</span> &raquo;', 'hemingway' ) ); ?></div>
  31. <div class="clear"></div>
  32. </div> <!-- /comment-nav-below -->
  33. <?php endif; ?>
  34. </div><!-- /comments -->
  35. <?php endif; ?>
  36. <?php if ( ! comments_open() && !is_page() ) : ?>
  37. <p class="nocomments"><?php _e( 'Comments are closed.', 'hemingway' ); ?></p>
  38. <?php endif; ?>
  39. <?php $comments_args = array(
  40. 'comment_notes_before' =>
  41. '<p class="comment-notes">' . __( 'Your email address will not be published.', 'hemingway' ) . '</p>',
  42. 'comment_field' =>
  43. '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="6" required>' . '</textarea></p>',
  44. 'fields' => apply_filters( 'comment_form_default_fields', array(
  45. 'author' =>
  46. '<p class="comment-form-author">' .
  47. '<input id="author" name="author" type="text" placeholder="' . __('Name','hemingway') . '" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" />' . '<label for="author">Author</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '</p>',
  48. 'email' =>
  49. '<p class="comment-form-email">' . '<input id="email" name="email" type="text" placeholder="' . __('Email','hemingway') . '" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" /><label for="email">Email</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '</p>',
  50. 'url' =>
  51. '<p class="comment-form-url">' . '<input id="url" name="url" type="text" placeholder="' . __('Website','hemingway') . '" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /><label for="url">Website</label></p>')
  52. ),
  53. );
  54. comment_form($comments_args);
  55. ?>