Advertisement
Guest User

Untitled

a guest
May 6th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. <?php
  2. if ( !empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) ) {
  3. die( __('Please do not load this page directly. Thanks!', 'arras') );
  4. }
  5.  
  6. if ( post_password_required() ) {
  7. ?> <h4 class="module-title"><?php _e('Password Required', 'arras') ?></h4> <?php
  8. _e('<p class="nocomments">This post is password protected. Enter the password to view comments.</p>', 'arras');
  9. return;
  10. }
  11.  
  12. $comments_by_type = &separate_comments($comments);
  13.  
  14. if ( have_comments() ) : ?>
  15.  
  16. <?php if ( !empty($comments_by_type['comment']) ) : ?>
  17. <h4 class="module-title"><?php comments_number( __('No Comments', 'arras'), __('1 Comment', 'arras'), _n('% Comment', '% Comments', get_comments_number(), 'arras') ); ?></h4>
  18. <ol id="commentlist" class="clearfix">
  19. <?php wp_list_comments('type=comment&callback=arras_list_comments'); ?>
  20. </ol>
  21. <?php endif; ?>
  22.  
  23. <div class="comments-navigation clearfix">
  24. <?php paginate_comments_links() ?>
  25. </div>
  26.  
  27. <?php if ( !empty($comments_by_type['pings']) ) : ?>
  28. <h4 class="module-title"><?php _e('Trackbacks / Pings', 'arras') ?></h4>
  29. <ol class="pingbacks"><?php wp_list_comments('type=pings&callback=arras_list_trackbacks'); ?></ol>
  30. <?php endif; ?>
  31.  
  32. <?php else: ?>
  33. <?php if ('open' == $post->comment_status) : ?>
  34. <h4 class="module-title"><?php _e('No Comments', 'arras') ?></h4>
  35. <p class="nocomments"><?php _e('Start the ball rolling by posting a comment on this article!', 'arras') ?></p>
  36. <?php endif ?>
  37. <?php endif; ?>
  38.  
  39. <?php if ('closed' == $post->comment_status) : if (!is_page()) : ?>
  40. <h4 class="module-title"><?php _e('Comments Closed', 'arras') ?></h4>
  41. <p class="nocomments"><?php _e('Comments are closed. You will not be able to post a comment in this post.', 'arras') ?></p>
  42. <?php endif; else: ?>
  43.  
  44. <?php
  45. $req = get_option('require_name_email');
  46. $aria_req = ( $req ? ' aria-required="true"' : '' );
  47. $commenter = wp_get_current_commenter();
  48.  
  49. comment_form(
  50. array(
  51. 'fields' => array(
  52. 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
  53. '<input id="author" class="required" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
  54. 'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
  55. '<input id="email" class="required email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
  56. 'url' => '<!-- <p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label>' .
  57. '<input id="url" class="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p> -->'
  58. ),
  59. 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" class="required"></textarea></p>'
  60. )
  61. );
  62. ?>
  63.  
  64. <?php endif ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement