WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY p.ID) ORDER BY p.ID' at line 18]
SELECT DISTINCT t.* FROM wp_posts AS p LEFT JOIN wp_term_relationships tr ON p.ID = tr.object_id LEFT JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id LEFT JOIN wp_terms t ON t.term_id = tt.term_id WHERE p.post_type='post' AND p.post_status = 'publish' AND tt.taxonomy = 'post_tag' AND p.ID IN (SELECT p.ID FROM wp_posts AS p LEFT JOIN wp_term_relationships tr ON p.ID = tr.object_id LEFT JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id LEFT JOIN wp_terms t ON t.term_id = tt.term_id WHERE p.post_type='post' AND p.post_status = 'publish' AND tt.taxonomy = 'category' AND tt.term_taxonomy_id= ORDER BY p.ID) ORDER BY p.ID