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.
 
 
 
 
 
 

46 line
1.4 KiB

  1. <?php
  2. if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) ) {
  3. die ( 'Please do not load this page directly. Thanks.' );
  4. }
  5. /*
  6. * If the current post is protected by a password and
  7. * the visitor has not yet entered the password we will
  8. * return early without loading the comments.
  9. */
  10. if ( post_password_required() ) {
  11. return;
  12. }
  13. ?>
  14. <section id="comments" class="clear comments-area">
  15. <?php if ( comments_open() || have_comments() ) { ?>
  16. <h2 class="comments-title"><?php echo __('Discussion', 'sandbox'); ?> (<?php comments_number(__('No comments', 'sandbox'), __('<span>One</span> Comment', 'sandbox'), __('<span>%</span> Comments', 'sandbox') );?>)</h2>
  17. <?php if ( comments_open() ) { ?>
  18. <?php comment_form(); ?>
  19. <?php } ?>
  20. <?php if ( have_comments() ) { ?>
  21. <ol class="comment-list">
  22. <?php
  23. wp_list_comments(array(
  24. 'style' => 'ol',
  25. 'short_ping' => true,
  26. 'avatar_size' => 150,
  27. 'callback' => 'sandbox_comment_item',
  28. ));
  29. ?>
  30. </ol>
  31. <?php } ?>
  32. <?php } else { ?>
  33. <h2 class="comments-title"><?php
  34. if ( !comments_open() ) {
  35. ?><span class="comments-closed"><?php _e( 'Comments are closed', 'sandbox' ); ?></span><?php
  36. } ?><?php
  37. if ( !have_comments() ) {
  38. ?> - <span class="no-comments"><?php _e( 'No Comments written', 'sandbox' ); ?></span><?php
  39. } ?></h2>
  40. <?php } ?>
  41. </section><!-- #comments -->