Database Error; SQL: SELECT
DISTINCT
`t`.*
FROM `wp_posts` AS `t`
LEFT JOIN `wp_postmeta` AS `article_link_override_url` ON
`article_link_override_url`.`meta_key` = 'article_link_override_url'
AND `article_link_override_url`.`post_id` = `t`.`ID`
LEFT JOIN `wp_icl_translations` AS `wpml_translations`
ON `wpml_translations`.`element_id` = `t`.`ID`
AND `wpml_translations`.`element_type` = 'post_blog'
AND `wpml_translations`.`language_code` = 'en'
LEFT JOIN `wp_icl_languages` AS `wpml_languages`
ON `wpml_languages`.`code` = `wpml_translations`.`language_code` AND `wpml_languages`.`active` = 1
WHERE ( ( CAST(post_date AS DATETIME) < "2019-04-17 08:30:32" AND TRIM(`article_link_override_url`.`meta_value`) = "" AND NOT t.id = ) AND ( `t`.`post_type` = 'blog' ) AND ( `wpml_languages`.`code` IS NOT NULL ) AND ( `t`.`post_status` IN ( 'publish' ) ) )
ORDER BY `t`.`post_date` DESC, `t`.`menu_order`, `t`.`post_title`, `t`.`post_date`
LIMIT 0, 1; Response: 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 ') AND ( `t`.`post_type` = 'blog' ) AND ( `wpml_languages`.`code` IS NOT NULL ...' at line 21