SELECT SQL_CALC_FOUND_ROWS `wp_posts` . `ID` FROM `wp_posts` WHERE ? = ? AND `wp_posts` . `post_type` = ? AND ( `wp_posts` . `post_status` = ? OR `wp_posts` . `post_status` = ? OR `wp_posts` . `post_status` = ? OR `wp_posts` . `post_status` = ? OR `wp_posts` . `post_status` = ? ) AND ( SELECT ? FROM `wp_term_relationships` INNER JOIN `wp_term_taxonomy` ON `wp_term_taxonomy` . `term_taxonomy_id` = `wp_term_relationships` . `term_taxonomy_id` INNER JOIN `wp_terms` ON `wp_terms` . `term_id` = `wp_term_taxonomy` . `term_id` WHERE `wp_term_taxonomy` . `taxonomy` = ? AND `wp_term_relationships` . `object_id` = `wp_posts` . `ID` AND `wp_terms` . `term_group` IN (...) LIMIT ? ) ORDER BY `wp_posts` . `post_date` DESC LIMIT ?, ... 