Wordpress WordPress query to fetch the posts April 12, 2011 Pramod T P Leave a comment <?php global $wpdb; $querystr = " SELECT distinct(post_title) ,ID,post_title FROM $wpdb->posts WHERE post_type='post' AND post_status='publish' "; $pageposts = $wpdb->get_results($querystr, OBJECT); ?>