Return to Snippet

Revision: 20413
at November 15, 2009 11:52 by warrenonline


Initial Code
<!-- recent comment of each post -->

<div class="recent-comment">
 <?php
	$comment_array = array_reverse(get_approved_comments($wp_query->post->ID));
	$count = 1;
 ?>

<?php if ($comment_array) {  ?>
	<span class="comment"> <?php comments_number('No comment','1 comment','% comments'); ?></span> - Latest by:
	<ul class="commentlist">
		<?php foreach($comment_array as $comment){ ?>
			<?php if ($count++ <= 2) { ?>
				<li><?php comment_author_link(); ?> <br /> <?php comment_excerpt(); ?> </li>
			<?php } ?>
		<?php } ?>
	</ul>
<?php } else { ?> <!-- if there was no comment in that post,yet -->
		<span class="comment">No comment so far</span>
<?php } ?>
</div>

<!-- end recent comment-->

Initial URL
http://warrenonline.ca

Initial Description
Just the basic Wordpress comments loop.

Initial Title
Wordpress Comments Loop

Initial Tags
wordpress

Initial Language
PHP