comments.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * The template used to display Comments
  4. *
  5. * The area of the page that contains both current comments
  6. * and the comment form. The actual display of comments is
  7. * handled by a callback to twentyten_comment which is
  8. * located in the functions.php file
  9. *
  10. * @package WordPress
  11. * @subpackage Twenty Ten
  12. * @since 3.0.0
  13. */
  14. ?>
  15. <div id="comments">
  16. <?php if ( post_password_required() ) : ?>
  17. <div class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></div>
  18. </div><!-- .comments -->
  19. <?php
  20. return;
  21. endif;
  22. ?>
  23. <?php
  24. // You can start editing here -- including this comment!
  25. ?>
  26. <?php if ( have_comments() ) : ?>
  27. <h3 id="comments-title"><?php comments_number(
  28. sprintf( __( 'No Responses to %s', 'twentyten' ), '<em>' . get_the_title() . '</em>' ),
  29. sprintf( __( 'One Response to %s', 'twentyten' ), '<em>' . get_the_title() . '</em>' ),
  30. sprintf( __( '%% Responses to %s', 'twentyten' ), '<em>' . get_the_title() . '</em>' )
  31. ); ?> </h3>
  32. <?php if ( get_comment_pages_count() > 1 ) : // are there comments to navigate through ?>
  33. <div class="navigation">
  34. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyten' ) ); ?></div>
  35. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyten' ) ); ?></div>
  36. </div>
  37. <?php endif; // check for comment navigation ?>
  38. <ol class="commentlist">
  39. <?php wp_list_comments( array( 'callback' => 'twentyten_comment' ) ); ?>
  40. </ol>
  41. <?php if ( get_comment_pages_count() > 1 ) : // are there comments to navigate through ?>
  42. <div class="navigation">
  43. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyten' ) ); ?></div>
  44. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyten' ) ); ?></div>
  45. </div>
  46. <?php endif; // check for comment navigation ?>
  47. <?php else : // this is displayed if there are no comments so far ?>
  48. <?php if ( comments_open() ) : // If comments are open, but there are no comments ?>
  49. <?php else : // if comments are closed ?>
  50. <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyten' ); ?></p>
  51. <?php endif; ?>
  52. <?php endif; ?>
  53. <?php comment_form(); ?>
  54. </div><!-- #comments -->