SELECT `wp_posts` . * FROM `wp_posts` INNER JOIN `wp_postmeta` ON ( `wp_posts` . `ID` = `wp_postmeta` . `post_id` ) WHERE ? = ? AND ( ( `wp_postmeta` . `meta_key` = ? AND `wp_postmeta` . `meta_value` = ? ) ) AND `wp_posts` . `post_type` = ? GROUP BY `wp_posts` . `ID` ORDER BY `wp_posts` . `post_date` DESC 