In list with recent coments – only show one comment per page/post (latest comment)
First you should KNOW all different posts with comments: global $wpdb; $SelectSQL = “SELECT DISTINCT `comment_post_ID` FROM {$wpdb->comments} LIMIT 0, 15”; $Rows = $wpdb->get_results($SelectSQL); then for each of these posts get the latest comment: foreach($Rows as $row): $comment = get_comments(array(‘post_id’=>$row->comment_post_ID, ‘number’=>1, ‘status’=>’appprove’)); $comment = $comment[0]; … and continue with the display of comment, hope you … Read more