Want more features on Pastebin? Sign Up, it's FREE!
Guest

comments

By: a guest on Mar 26th, 2013  |  syntax: None  |  size: 3.20 KB  |  views: 94  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.         <div class="navigation">
  18.                 <div class="next-posts"><?php previous_comments_link() ?></div>
  19.                 <div class="prev-posts"><?php next_comments_link() ?></div>
  20.         </div>
  21.  
  22.         <ol class="commentlist">
  23.                 <?php wp_list_comments(); ?>
  24.         </ol>
  25.  
  26.         <div class="navigation">
  27.                 <div class="next-posts"><?php previous_comments_link() ?></div>
  28.                 <div class="prev-posts"><?php next_comments_link() ?></div>
  29.         </div>
  30.        
  31.  <?php else : // this is displayed if there are no comments so far ?>
  32.  
  33.         <?php if ( comments_open() ) : ?>
  34.                 <!-- If comments are open, but there are no comments. -->
  35.  
  36.          <?php else : // comments are closed ?>
  37.                 <p>Comments are closed.</p>
  38.  
  39.         <?php endif; ?>
  40.        
  41. <?php endif; ?>
  42.  
  43. <?php if ( comments_open() ) : ?>
  44.  
  45. <div id="respond">
  46.  
  47.         <h2><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h2>
  48.  
  49.         <div class="cancel-comment-reply">
  50.                 <?php cancel_comment_reply_link(); ?>
  51.         </div>
  52.  
  53.         <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
  54.                 <p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p>
  55.         <?php else : ?>
  56.  
  57.         <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  58.  
  59.                 <?php if ( is_user_logged_in() ) : ?>
  60.  
  61.                         <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>
  62.  
  63.                 <?php else : ?>
  64.  
  65.                         <div>
  66.                                 <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'"; ?> />
  67.                                 <label for="author">Name <?php if ($req) echo "(required)"; ?></label>
  68.                         </div>
  69.  
  70.                         <div>
  71.                                 <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'"; ?> />
  72.                                 <label for="email">Mail (will not be published) <?php if ($req) echo "(required)"; ?></label>
  73.                         </div>
  74.  
  75.                         <div>
  76.                                 <input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
  77.                                 <label for="url">Website</label>
  78.                         </div>
  79.  
  80.                 <?php endif; ?>
  81.  
  82.                 <!--<p>You can use these tags: <code><?php echo allowed_tags(); ?></code></p>-->
  83.  
  84.                 <div>
  85.                         <textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea>
  86.                 </div>
  87.  
  88.                 <div>
  89.                         <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
  90.                         <?php comment_id_fields(); ?>
  91.                 </div>
  92.                
  93.                 <?php do_action('comment_form', $post->ID); ?>
  94.  
  95.         </form>
  96.  
  97.         <?php endif; // If registration required and not logged in ?>
  98.        
  99. </div>
  100.  
  101. <?php endif; ?>
clone this paste RAW Paste Data