KLoning Spoon

<?php
$comments = get_comments('status=approve&number=5');

if ($comments) {
    echo '<ul id="recent_comments">';

    foreach ($comments as $comment) {
        echo '<li><a href="'. get_permalink($comment->comment_post_ID).'#comment-'.$comment->comment_ID .'" title="'.$comment->comment_author .' | '.get_the_title($comment->comment_post_ID).'">' . get_avatar( $comment->comment_author_email, $img_w);
        echo '<span class="recent_comment_name">' . $comment->comment_author . ': </span>';
		$comment_string = $comment->comment_content;
		$comment_excerpt = substr($comment_string,0,100);

		echo $comment_excerpt;

		if (strlen($comment_excerpt) > 99){
			echo ' ...';
		}
        echo '</a></li>';
    }
    echo '</ul>';
}
else{
	echo '<ul id="recent_comments">
	          <li>No Comments Yet</li>
	      </ul>';
}
?>

  1. kloningspoon posted this
Blog comments powered by Disqus