comments.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <div id="comments" class="comments-area">
  2. <?php if ( post_password_required() ) : ?>
  3. <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', '_ph' ); ?></p>
  4. </div>
  5. <?php return; endif; ?>
  6. <?php if ( have_comments() ) : ?>
  7. <h2 class="comments-title">
  8. <?php
  9. printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), '_ph' ),
  10. number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
  11. ?>
  12. </h2>
  13. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  14. <nav role="navigation" id="comment-nav-above" class="site-navigation comment-navigation">
  15. <h1 class="assistive-text"><?php _e( 'Comment navigation', '_ph' ); ?></h1>
  16. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', '_ph' ) ); ?></div>
  17. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', '_ph' ) ); ?></div>
  18. </nav>
  19. <?php endif;?>
  20. <ol class="commentlist">
  21. <?php wp_list_comments( array( 'callback' => '_s_comment' ) ); ?>
  22. </ol>
  23. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  24. <nav role="navigation" id="comment-nav-below" class="site-navigation comment-navigation">
  25. <h1 class="assistive-text"><?php _e( 'Comment navigation', '_s' ); ?></h1>
  26. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', '_ph' ) ); ?></div>
  27. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', '_ph' ) ); ?></div>
  28. </nav>
  29. <?php endif; ?>
  30. <?php endif; ?>
  31. <?php if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
  32. <p class="nocomments"><?php _e( 'Comments are closed.', '_ph' ); ?></p>
  33. <?php endif; ?>
  34. <?php comment_form(); ?>
  35. </div>