A WordPress theme I used to use on www.chriswiegman.com.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

72 lines
2.3 KiB

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