Posted By

ricosushi on 08/10/10


Tagged

wordpress comments


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ricosushi


wordpress comments


 / Published in: PHP
 

WP comments basic structure

  1. <?php if(!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) : ?>
  2. <?php endif; ?>
  3.  
  4. <?php if(!empty($post->post_password)) : ?>
  5. <?php if($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
  6. <?php endif; ?>
  7. <?php endif; ?>
  8.  
  9. <?php if($comments) : ?>
  10. <?php foreach($comments as $comment) : ?>
  11. <?php if ($comment->comment_approved == '0') : ?>
  12. <?php endif; ?>
  13. <?php endforeach; ?>
  14. <?php else : ?>
  15. <?php endif; ?>
  16.  
  17. <?php if(comments_open()) : ?>
  18. <?php if(get_option('comment_registration') && !$user_ID) : ?>
  19. <?php else : ?>
  20. <?php if($user_ID) : ?>
  21. <?php else : ?>
  22. <?php endif; ?>
  23. <?php endif; ?>
  24. <?php else : ?>
  25. <?php endif; ?>

Report this snippet  

You need to login to post a comment.