WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/11/2008 07:25:50 PM (12 years ago)
Author:
ryan
Message:

wp_list_comments() and threaded comment support. First cut. see #7635

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/default/comments.php

    r8800 r8869  
    88        return;
    99    }
    10 
    11     /* This variable is for alternating comment background */
    12     $oddcomment = 'alt';
    1310?>
    1411
    1512<!-- You can start editing here. -->
    1613
    17 <?php if ($comments) : ?>
     14<?php if ( have_comments() ) : ?>
    1815    <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3>
    1916
    2017    <ol class="commentlist">
    21 
    22     <?php foreach ($comments as $comment) : ?>
    23 
    24         <li <?php comment_class($oddcomment) ?> id="comment-<?php comment_ID() ?>">
    25             <?php echo get_avatar( $comment, 32 ); ?>
    26             <cite><?php comment_author_link() ?></cite> Says:
    27             <?php if ($comment->comment_approved == '0') : ?>
    28             <em>Your comment is awaiting moderation.</em>
    29             <?php endif; ?>
    30             <br />
    31 
    32             <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?></small>
    33 
    34             <?php comment_text() ?>
    35 
    36         </li>
    37 
    38     <?php
    39         /* Changes every other comment to a different class */
    40         $oddcomment = ( empty( $oddcomment ) ) ? 'alt' : '';
    41     ?>
    42 
    43     <?php endforeach; /* end for each comment */ ?>
    44 
     18    <?php wp_list_comments($comments); ?>
    4519    </ol>
    4620
     
    6034<?php if ('open' == $post->comment_status) : ?>
    6135
    62 <h3 id="respond">Leave a Reply</h3>
     36<div id="respond">
     37
     38<h3>Leave a Reply</h3>
     39
     40<div id="cancel-comment-reply" style="display: none;">
     41    <small><?php echo cancel_comment_reply_link() ?></small>
     42</div>
    6343
    6444<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
     
    9171<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    9272<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
     73<input type="hidden" name="comment_parent" id="comment-parent" value="0" />
    9374</p>
    9475<?php do_action('comment_form', $post->ID); ?>
    9576
    9677</form>
     78</div>
    9779
    9880<?php endif; // If registration required and not logged in ?>
Note: See TracChangeset for help on using the changeset viewer.