Using get_posts() instead of using $wpdb