comments.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 Intergalactic 2
  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', 'intergalactic-2' ),
  25. number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
  26. ?>
  27. </h2>
  28. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  29. <nav id="comment-nav-above" class="comment-navigation" role="navigation">
  30. <h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'intergalactic-2' ); ?></h1>
  31. <div class="nav-previous"><?php previous_comments_link( esc_html__( '&larr; Older Comments', 'intergalactic-2' ) ); ?></div>
  32. <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments &rarr;', 'intergalactic-2' ) ); ?></div>
  33. </nav><!-- #comment-nav-above -->
  34. <?php endif; // check for comment navigation ?>
  35. <ol class="comment-list">
  36. <?php
  37. wp_list_comments( array(
  38. 'style' => 'ol',
  39. 'short_ping' => true,
  40. 'avatar_size'=> 75,
  41. ) );
  42. ?>
  43. </ol><!-- .comment-list -->
  44. <?php endif; // have_comments() ?>
  45. <?php
  46. // If comments are closed and there are comments, let's leave a little note, shall we?
  47. if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
  48. ?>
  49. <p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'intergalactic-2' ); ?></p>
  50. <?php endif; ?>
  51. <?php comment_form(); ?>
  52. </div><!-- #comments -->