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 ') GROUP BY terms.term_id' at line 15] SELECT COUNT( DISTINCT wp__posts.ID ) as term_count, terms.term_id as term_count_id FROM wp__posts
INNER JOIN wp__term_relationships AS term_relationships ON wp__posts.ID = term_relationships.object_id
INNER JOIN wp__term_taxonomy AS term_taxonomy USING( term_taxonomy_id )
INNER JOIN wp__terms AS terms USING( term_id )
LEFT JOIN wp__term_relationships ON (wp__posts.ID = wp__term_relationships.object_id)
WHERE wp__posts.post_type IN ( 'product' )
AND wp__posts.post_status = 'publish' AND (
wp__posts.ID NOT IN (
SELECT object_id
FROM wp__term_relationships
WHERE term_taxonomy_id IN (7)
)
AND
wp__term_relationships.term_taxonomy_id IN (96)
)AND terms.term_id IN () GROUP BY terms.term_id