PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/catch-box/comments.php

https://github.com/ActivateNY/activateny.org
PHP | 77 lines | 44 code | 8 blank | 25 comment | 8 complexity | ea81fac1c82503f0b06a88faaf7681f7 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  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. The actual display of comments is
  7. * handled by a callback to catchbox_comment() which is
  8. * located in the functions.php file.
  9. *
  10. * @package Catch Themes
  11. * @subpackage Catch_Box
  12. * @since Catch Box 1.0
  13. */
  14. ?>
  15. <div id="comments">
  16. <?php if ( post_password_required() ) : ?>
  17. <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'catchbox' ); ?></p>
  18. </div><!-- #comments -->
  19. <?php
  20. /* Stop the rest of comments.php from being processed,
  21. * but don't kill the script entirely -- we still have
  22. * to fully load the template.
  23. */
  24. return;
  25. endif;
  26. ?>
  27. <?php // You can start editing here -- including this comment! ?>
  28. <?php if ( have_comments() ) : ?>
  29. <h2 id="comments-title">
  30. <?php
  31. printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'catchbox' ),
  32. number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
  33. ?>
  34. </h2>
  35. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  36. <nav id="comment-nav-above">
  37. <h1 class="assistive-text"><?php _e( 'Comment navigation', 'catchbox' ); ?></h1>
  38. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'catchbox' ) ); ?></div>
  39. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'catchbox' ) ); ?></div>
  40. </nav>
  41. <?php endif; // check for comment navigation ?>
  42. <ol class="commentlist">
  43. <?php
  44. /* Loop through and list the comments. Tell wp_list_comments()
  45. * to use catchbox_comment() to format the comments.
  46. * If you want to overload this in a child theme then you can
  47. * define catchbox_comment() and that will be used instead.
  48. * See catchbox_comment() in catchbox/functions.php for more.
  49. */
  50. wp_list_comments( array( 'callback' => 'catchbox_comment' ) );
  51. ?>
  52. </ol>
  53. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  54. <nav id="comment-nav-below">
  55. <h1 class="assistive-text"><?php _e( 'Comment navigation', 'catchbox' ); ?></h1>
  56. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'catchbox' ) ); ?></div>
  57. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'catchbox' ) ); ?></div>
  58. </nav>
  59. <?php endif; // check for comment navigation ?>
  60. <?php
  61. /* If there are no comments and comments are closed, let's leave a little note, shall we?
  62. * But we don't want the note on pages or post types that do not support comments.
  63. */
  64. elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) :
  65. ?>
  66. <p class="nocomments"><?php _e( 'Comments are closed.', 'catchbox' ); ?></p>
  67. <?php endif; ?>
  68. <?php comment_form(); ?>
  69. </div><!-- #comments -->