Advertisement
Guest User

comments.php

a guest
Sep 8th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. <?php
  2. /**
  3. * Comments Template
  4. *
  5. * This template file handles the display of comments, pingbacks and trackbacks.
  6. *
  7. * External functions are used to display the various types of comments.
  8. *
  9. * @package WooFramework
  10. * @subpackage Template
  11. */
  12.  
  13. // Do not delete these lines
  14. if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) ) { die ( __( 'Please do not load this page directly. Thanks!', 'woothemes' ) ); }
  15.  
  16. // Password is required so don't display comments.
  17. if ( post_password_required() ) { ?><p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view comments.', 'woothemes' ); ?></p><?php return; }
  18.  
  19. /**
  20. * Comment Output.
  21. *
  22. * This is where our comments display is generated.
  23. */
  24.  
  25. $comments_by_type = &separate_comments( $comments );
  26.  
  27. // You can start editing here -- including this comment!
  28.  
  29. if ( have_comments() ) {
  30.  
  31. echo '<div id="comments">';
  32.  
  33. if ( ! empty( $comments_by_type['comment'] ) ) { ?>
  34. <h3 id="comments-title"><?php printf( _n( 'One Comment on %2$s', '%1$s Comments on %2$s', get_comments_number(), 'woothemes' ), number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em> - <a href="#respond">Add Yours!</a>' ); ?></h3>
  35. <ol class="commentlist">
  36. <?php
  37. /* Loop through and list the comments. Tell wp_list_comments()
  38. * to use custom_comment() to format the comments.
  39. * If you want to overload this in a child theme then you can
  40. * define custom_comment() and that will be used instead.
  41. * See custom_comment() in /includes/theme-comments.php for more.
  42. */
  43. wp_list_comments( array( 'callback' => 'custom_comment', 'type' => 'comment', 'avatar_size' => 70 ) );
  44. ?>
  45. </ol>
  46. <?php
  47. // Comment pagination.
  48. if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { ?>
  49. <div class="navigation">
  50. <div class="nav-previous fl"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'woothemes' ) ); ?></div>
  51. <div class="nav-next fr"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'woothemes' ) ); ?></div>
  52. <div class="fix"></div><!--/.fix-->
  53. </div><!-- .navigation -->
  54. <?php } // End IF Statement
  55.  
  56. } // End empty($comments_by_type['comment'] IF Statement
  57.  
  58. if ( ! empty( $comments_by_type['pings'] ) ) { ?>
  59. <h3 id="comments-title"><?php _e( 'Trackbacks/Pingbacks', 'woothemes' ); ?></h3>
  60. <ol class="commentlist">
  61. <?php
  62. /* Loop through and list the pings. Tell wp_list_comments()
  63. * to use list_pings() to format the pings.
  64. * If you want to overload this in a child theme then you can
  65. * define list_pings() and that will be used instead.
  66. * See list_pings() in /includes/theme-comments.php for more.
  67. */
  68. wp_list_comments( array( 'callback' => 'list_pings', 'type' => 'pings' ) );
  69. ?>
  70. </ol>
  71. <?php }
  72.  
  73. echo '</div>';
  74.  
  75. } else {
  76.  
  77. echo '<div id="comments">';
  78.  
  79. // If there are no comments and comments are closed, let's leave a little note, shall we?
  80. if ( ! comments_open() && is_singular() ) { ?><h5 class="nocomments"><?php _e( 'Comments are closed.', 'woothemes' ); ?></h5><?php }
  81. else { ?><h3 class="nocomments"><?php _e( 'No comments yet. Be the first&#33; - <a href="#respond">Add Yours!</a>', 'woothemes' ); ?></h3><?php }
  82.  
  83. echo '</div>';
  84.  
  85. } // End IF Statement
  86.  
  87. /**
  88. * Respond Form.
  89. *
  90. * This is where the comment form is generated.
  91. */
  92.  
  93. comment_form();
  94. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement