Advertisement
chelle

min comments template

Sep 5th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  1. <?php // Do not delete these lines
  2. if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  3. die (__('Please do not load this page directly. Thanks!','min'));
  4. if (!empty($post->post_password)) { // if there's a password
  5. if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
  6. ?>
  7. <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.','min'); ?></p>
  8. <?php
  9. return;
  10. }
  11. }
  12. /* This variable is for alternating comment background */
  13. $oddcomment = 'class="alt" ';
  14. ?>
  15. <!-- You can start editing here. -->
  16. <?php if ($comments) : ?>
  17. <div id="comments">
  18. <h3><?php comments_number(__('No comments yet.','min'), __('There is 1 comment in this article:','min'), __('There are % comments in this article:','min') );?></h3>
  19. <ol>
  20. <?php foreach ($comments as $comment) : ?>
  21. <li id="comment-<?php comment_ID() ?>" class="comment <?php if (get_comment_author_email() == get_the_author_meta('user_email')) { echo ('highlighted'); }?>">
  22. <?php if ($comment->comment_approved == '0') : ?>
  23. <p class="moderation"><?php _e('Your comment will be published when it is approved.','min'); ?></p>
  24. <?php endif; ?>
  25. <cite><span class="date"><?php comment_date(__('m/j/Y','min')) ?></span><?php comment_author_link() ?> says:</cite>
  26. <blockquote>
  27. <?php comment_text(); ?>
  28. </blockquote>
  29. </li>
  30. <?php endforeach; /* end for each comment */ ?>
  31. </ol>
  32. </div><!-- close:comments -->
  33. <?php else : // this is displayed if there are no comments so far ?>
  34. <?php if ('open' == $post->comment_status) : ?>
  35. <!-- If comments are open, but there are no comments. -->
  36. <div id="comments">
  37. <h3><?php _e('No comments yet.','min'); ?></h3>
  38. </div><!-- close:comments -->
  39. <?php else : // comments are closed ?>
  40. <!-- If comments are closed. -->
  41. <div id="comments">
  42. <h3><?php _e('Comments are closed.','min'); ?></h3>
  43. </div><!-- close:comments -->
  44. <?php endif; ?>
  45. <?php endif; ?>
  46. <?php if ('open' == $post->comment_status) : ?>
  47. <div id="commentform">
  48. <h3><?php _e('Write a comment','min'); ?>:</h3>
  49. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  50. <p><?php _e('You have to','min'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?php _e('log in','min'); ?></a> <?php _e('to write a comment.','min'); ?></p>
  51. <?php else : ?>
  52. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" name="comment-form">
  53. <?php if ( $user_ID ) : ?>
  54. <p><a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a> | <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account','min') ?>"><?php _e('Logout','min') ?> &raquo;</a></p>
  55. <?php else : ?>
  56. <p>
  57. <input type="text" name="author" id="author" class="input-text" value="<?php echo $comment_author; ?>" size="22" />
  58. <label for="author"><?php _e('Name','min'); ?> <?php if ($req) _e('(needed)','min'); ?></label>
  59. </p>
  60. <p>
  61. <input type="text" name="email" id="email" class="input-text" value="<?php echo $comment_author_email; ?>" size="22" />
  62. <label for="email"><?php _e('Email','min'); ?> <?php if ($req) _e('(needed but it will not be published)','min'); ?></label>
  63. </p>
  64. <p>
  65. <input type="text" name="url" id="url" class="input-text" value="<?php echo $comment_author_url; ?>" size="22" />
  66. <label for="url"><?php _e('Website (if you have one)','min'); ?></label>
  67. </p>
  68. <?php endif; ?>
  69. <p>
  70. <textarea name="comment" id="comment" cols="100%" rows="10"></textarea>
  71. </p>
  72. <p class="input-submit">
  73. <input name="submit-comment" type="submit" id="submit-comment" value="<?php _e('comment','min'); ?>" />
  74. <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  75. </p>
  76. <?php do_action('comment_form', $post->ID); ?>
  77. </form>
  78. </div><!-- close:commentform -->
  79. <?php endif; // If registration required and not logged in ?>
  80. <?php endif; // if you delete this the sky will fall on your head ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement