Advertisement
prettysenshi

comments.php

Jun 15th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. <?php
  2.  
  3. if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  4. die ('Please do not load this page directly. Thanks!');
  5.  
  6. if ( post_password_required() ) { ?>
  7. This post is password protected. Enter the password to view comments.
  8. <?php
  9. return;
  10. }
  11. ?>
  12.  
  13. <?php if ( have_comments() ) : ?>
  14.  
  15. <h2 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?></h2>
  16.  
  17.  
  18. <?php previous_comments_link() ?>
  19. <?php next_comments_link() ?>
  20.  
  21. <?php wp_list_comments( 'type=comment&callback=hateyour_comment' ); ?>
  22.  
  23.  
  24. <?php previous_comments_link() ?>
  25. <?php next_comments_link() ?>
  26.  
  27.  
  28. <?php else : // this is displayed if there are no comments so far ?>
  29.  
  30. <?php if ( comments_open() ) : ?>
  31. <!-- If comments are open, but there are no comments. -->
  32.  
  33. <?php else : // comments are closed ?>
  34. <p>Comments are closed.</p>
  35.  
  36. <?php endif; ?>
  37.  
  38. <?php endif; ?>
  39.  
  40. <?php if ( comments_open() ) : ?>
  41.  
  42.  
  43.  
  44. <h2><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h2>
  45.  
  46.  
  47. <?php cancel_comment_reply_link(); ?>
  48.  
  49.  
  50. <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
  51. <p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p>
  52. <?php else : ?>
  53.  
  54. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  55.  
  56. <?php if ( is_user_logged_in() ) : ?>
  57.  
  58. <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>
  59.  
  60. <?php else : ?>
  61.  
  62.  
  63. <input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
  64. <label for="author">Name <?php if ($req) echo "(required)"; ?></label>
  65.  
  66.  
  67.  
  68. <input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
  69. <label for="email">Mail (will not be published) <?php if ($req) echo "(required)"; ?></label>
  70.  
  71.  
  72.  
  73. <input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
  74. <label for="url">Website</label>
  75.  
  76.  
  77. <?php endif; ?>
  78.  
  79. <!--<p>You can use these tags: <code><?php echo allowed_tags(); ?></code></p>-->
  80.  
  81.  
  82. <textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea>
  83.  
  84.  
  85.  
  86. <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
  87. <?php comment_id_fields(); ?>
  88.  
  89.  
  90. <?php do_action('comment_form', $post->ID); ?>
  91.  
  92. </form>
  93.  
  94. <?php endif; // If registration required and not logged in ?>
  95.  
  96.  
  97.  
  98. </center>
  99. <?php endif; ?>
  100. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement