Advertisement
Guest User

comments.php

a guest
Sep 6th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 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!');
  4.  
  5.     if ( post_password_required() ) {
  6.         echo "This post is password protected. Enter the password to view comments.";
  7.         return;
  8.     }
  9. ?>
  10.  
  11. <?php if ( have_comments() ) : ?>
  12.    
  13.     <h3><?php comments_number('No Comments', 'One Comment', 'Comments' );?></h3>
  14.  
  15.     <ul class="commentlist">
  16.         <?php //comment layout is in functions.php ?>
  17.         <?php wp_list_comments('callback=comment_layout'); ?>
  18.     </ul>
  19.  
  20.    
  21.  <?php else : // this is displayed if there are no comments so far ?>
  22.  
  23.     <?php if ( comments_open() ) : ?>
  24.         <!-- If comments are open, but there are no comments. -->
  25.  
  26.      <?php else : // comments are closed ?>
  27.         <p>Comments are closed.</p>
  28.  
  29.     <?php endif; ?>
  30.    
  31. <?php endif; ?>
  32.  
  33. <?php if ( comments_open() ) : ?>
  34. <?php //comment form is in functions.php ?>
  35. <?php echo '<form>'; ?>
  36. <?php echo '<fieldset class="span26"><legend>Comments Form</legend>'; ?>
  37. <?php comment_form();?>
  38. <?php echo '</fieldset>'; ?>
  39. <?php do_action('comment_form', $post->ID); ?>
  40. <?php echo '</form>'; ?>
  41. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement