In my sidebar for my Latest Comments, all I want is the commenter's name and the excerpt. What's being shown is their name, date, time and post title.
This is what you see now:
name - 2009-01-08 20:36:13
post title
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah …
And this is how I want it to be:
name
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah …
But I don't know what to take out of this code to achieve that.
<?php } ?>
<?php if (is_single() || is_home() || is_page() ) { ?>
<div class="kutu">
<div class="ust"><span></span></div><div class="spacer"><h2>LATEST COMMENTS</h2>
<?php global $wpdb, $comments, $comment;$comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID, comment_date, SUBSTRING(comment_content,1,150) AS comment_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 3"); ?>
<ul id="tab_content_comments" class="tab_content_list1"> <!-- Latest comments -->
<?php if ( $comments ) : foreach ($comments as $comment) :
echo '<li class="latestcomment">' . sprintf(__('%1$s <span class="commententrytitle"> - ' .strip_tags($comment->comment_date).
''.'
%2$s</span>
%4$s …'),get_the_title($comment->comment_post_ID),
get_permalink($comment->comment_post_ID),
strip_tags($comment->comment_excerpt) ) .'';
endforeach; endif; ?>
</div><div class="alt"><span></span></div></div>