PageRenderTime 50ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/Bochet/festival_lgbt
PHP | 74 lines | 48 code | 12 blank | 14 comment | 10 complexity | 7d1264de7b01a7f714dd0442d44095a4 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  1. <div id="comments">
  2. <?php if ( post_password_required() ) : ?>
  3. <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'Hero' ); ?></p>
  4. </div><!-- #comments -->
  5. <?php
  6. /* Stop the rest of comments.php from being processed,
  7. * but don't kill the script entirely -- we still have
  8. * to fully load the template.
  9. */
  10. return;
  11. endif;
  12. ?>
  13. <?php
  14. // You can start editing here -- including this comment!
  15. ?>
  16. <?php if ( have_comments() ) : ?>
  17. <?php if ( ! empty($comments_by_type['comment']) ) : ?>
  18. <h3 id="comments-title"><?php
  19. printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'Hero' ),
  20. number_format_i18n( get_comments_number() ), '' . get_the_title() . '' );
  21. ?></h3>
  22. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
  23. <div class="navigation">
  24. <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'Hero' ) ); ?></div>
  25. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'Hero' ) ); ?></div>
  26. </div> <!-- .navigation -->
  27. <?php endif; // check for comment navigation ?>
  28. <ol class="commentlist">
  29. <?php
  30. /* Loop through and list the comments. Tell wp_list_comments()
  31. * to use Hero_comment() to format the comments.
  32. * If you want to overload this in a child theme then you can
  33. * define Hero_comment() and that will be used instead.
  34. * See Hero_comment() in Hero/functions.php for more.
  35. */
  36. wp_list_comments('type=comment');
  37. ?>
  38. </ol>
  39. <?php endif; ?>
  40. <?php if ( ! empty($comments_by_type['pings']) ) : ?>
  41. <h3 id="pings"><?php _e( 'Trackbacks/Pingbacks', 'Hero' ); ?></h3>
  42. <ol class="commentlist">
  43. <?php wp_list_comments('type=pings&callback=Hero_list_pings'); ?>
  44. </ol>
  45. <?php endif; ?>
  46. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
  47. <div class="navigation">
  48. <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'Hero' ) ); ?></div>
  49. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'Hero' ) ); ?></div>
  50. </div><!-- .navigation -->
  51. <?php endif; // check for comment navigation ?>
  52. <?php else : // or, if we don't have comments:
  53. /* If there are no comments and comments are closed,
  54. * let's leave a little note, shall we?
  55. */
  56. if ( ! comments_open() ) :
  57. ?>
  58. <p class="nocomments"><?php _e( 'Comments are closed.', 'Hero' ); ?></p>
  59. <?php endif; // end ! comments_open() ?>
  60. <?php endif; // end have_comments() ?>
  61. <?php comment_form(array('comment_notes_before'=>'' ,'comment_notes_after'=>'' ,'label_submit'=>'Submit Comment') ); ?>
  62. </div><!-- #comments -->