comments.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * The template for displaying Comments.
  4. *
  5. * The area of the page that contains both current comments
  6. * and the comment form.
  7. *
  8. * @package Illustratr
  9. */
  10. /*
  11. * If the current post is protected by a password and
  12. * the visitor has not yet entered the password we will
  13. * return early without loading the comments.
  14. */
  15. if ( post_password_required() ) {
  16. return;
  17. }
  18. ?>
  19. <div id="comments" class="comments-area">
  20. <?php // You can start editing here -- including this comment! ?>
  21. <?php if ( have_comments() ) : ?>
  22. <h2 class="comments-title">
  23. <?php
  24. printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'illustratr' ),
  25. number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
  26. ?>
  27. </h2>
  28. <ol class="comment-list">
  29. <?php
  30. wp_list_comments( array(
  31. 'callback' => 'illustratr_comment',
  32. 'style' => 'ol',
  33. 'avatar_size' => 60,
  34. 'short_ping' => true,
  35. ) );
  36. ?>
  37. </ol><!-- .comment-list -->
  38. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  39. <nav id="comment-nav-below" class="comment-navigation" role="navigation">
  40. <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'illustratr' ); ?></h1>
  41. <div class="nav-links">
  42. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'illustratr' ) ); ?></div>
  43. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'illustratr' ) ); ?></div>
  44. </div><!-- .nav-links -->
  45. </nav><!-- #comment-nav-below -->
  46. <?php endif; // check for comment navigation ?>
  47. <?php endif; // have_comments() ?>
  48. <?php
  49. // If comments are closed and there are comments, let's leave a little note, shall we?
  50. if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
  51. ?>
  52. <p class="no-comments"><?php _e( 'Comments are closed.', 'illustratr' ); ?></p>
  53. <?php endif; ?>
  54. <?php comment_form(); ?>
  55. </div><!-- #comments -->