<?php $pop = $wpdb->get_results("SELECT DISTINCT comment_post_ID FROM $wpdb->comments WHERE comment_approved = 1 AND comment_post_ID NOT IN ( SELECT ID FROM $wpdb->posts WHERE post_type != 'post' OR post_status != 'publish' OR post_password != '' ) ORDER BY comment_date_gmt DESC LIMIT 6"); ?>