PageRenderTime 36ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/esquire/comments.php

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