• Hi !!

    I’m looking for a template tag which shows a list of the latest comments .. I couldn’t find anything, just plugins which I actually don’t want to use ..

    Is there a possibility ??

    Thanks,
    brainzina

Viewing 1 replies (of 1 total)
  • This block of code will fetch the latest 50 approved comments and display them. Put it in your theme file, such as sidebar.php, where you would like the comments to appear.

    <?php $comments = get_comments('number=50&status=approve'); ?>
    
    <ol class="commentlist">
    
    <?php
    	$comments = get_comments();
    	foreach ($comments as $comment) : ?>
    
    		<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
    			<div class="meta" /><cite><?php comment_author_link() ?></cite>
    			<small> on <?php comment_date('F jS, Y') ?> at <?php comment_time() ?> in
    			<a href="<?php echo get_permalink($comment->comment_post_ID);?>#comment-<?php comment_ID() ?>"><?php echo get_the_title($comment->comment_post_ID);?></a></small>
    			</div>
    			<div class="comment">
    			<?php comment_text() ?>
    			</div>
    		</li>
    
    	<?php endforeach; /* end for each comment */ ?>

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Latest Comments Tag’ is closed to new replies.