Advertisement
Guest User

comments.php

a guest
Apr 25th, 2012
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. <?php
  2. /**
  3. * @package WordPress
  4. * @subpackage Default_Theme
  5. */
  6.  
  7. // Do not delete these lines
  8. if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  9. die ('Please do not load this page directly. Thanks!');
  10.  
  11. if ( post_password_required() ) { ?>
  12. <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
  13. <?php
  14. return;
  15. }
  16. ?>
  17.  
  18. <!-- You can start editing here. -->
  19.  
  20. <div class="feedback-comments">
  21. <?php if ( have_comments() ) : ?>
  22. <h2 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h2>
  23.  
  24.  
  25. <div class="commentlist">
  26. <ul>
  27. <li>
  28. <?php wp_list_comments('callback=theme_comment'); ?>
  29. </li>
  30. </ul>
  31. </div>
  32.  
  33.  
  34. <?php else : // this is displayed if there are no comments so far ?>
  35.  
  36. <?php if ('open' == $post->comment_status) : ?>
  37. <!-- If comments are open, but there are no comments. -->
  38. <h2 style="color:#FF0000;">No Comments Yet</h2>
  39. <?php else : // comments are closed ?>
  40. <!-- If comments are closed. -->
  41. <p class="nocomments">Comments are closed.</p>
  42.  
  43. <?php endif; ?>
  44. <?php endif; ?>
  45. </div>
  46.  
  47. <?php if ( comments_open() ) : ?>
  48.  
  49. <div class="fillupform" id="respond">
  50. <h2><?php comment_form_title( 'Your Responses', 'Your Responses to %s' ); ?></h2>
  51.  
  52. <div class="cancel-comment-reply">
  53. <?php cancel_comment_reply_link(); ?>
  54. </div>
  55.  
  56. <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
  57.  
  58. <p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p>
  59.  
  60. <?php else : ?>
  61.  
  62. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  63.  
  64. <?php if ( is_user_logged_in() ) : ?>
  65. <p>
  66. Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>.
  67. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a>
  68. </p>
  69.  
  70. <?php else : ?>
  71.  
  72.  
  73.  
  74. <ul>
  75. <li>
  76. <label for="author">Name <?php if ($req) echo "*"; ?></label>
  77. <input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" tabindex="1" <?php if ($req) echo "area-required='true'"; ?> />
  78. </li>
  79.  
  80. <li>
  81. <label for="email">Email <?php if ($req) echo "*"; ?></label>
  82. <input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" tabindex="2" <?php if ($req) echo "area-required='true'"; ?> />
  83. </li>
  84. <li>
  85. <label for="url">URL</label>
  86. <input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" tabindex="3" />
  87. </li>
  88.  
  89. <?php endif; ?>
  90.  
  91. <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
  92.  
  93. <li>
  94. <label for="comment" style="vertical-align:top;">Message <?php if ($req) echo "*"; ?></label>
  95. <textarea name="comment" id="comment" cols="50%" rows="10" tabindex="4"></textarea>
  96. </li>
  97. <li>
  98. <label>&nbsp;</label>
  99. <input class="btn" type="submit" id="submit" tabindex="5" value="Hit me now!" />
  100. <?php comment_id_fields(); ?>
  101. </li>
  102.  
  103. <?php do_action('comment_form', $post->ID); ?>
  104.  
  105.  
  106. <?php endif; // If registration required and not logged in ?>
  107.  
  108. <?php endif; // if you delete this the sky will fall on your head ?>
  109. </ul>
  110. </form>
  111. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement