Test

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 'direction' at line 5]
SELECT * FROM wp_posts tP JOIN wp_postmeta tM ON tM.post_id = tP.ID AND tM.meta_key = 'namaste_course' AND tM.meta_value = 0 WHERE post_type = 'namaste_lesson' AND (post_status='publish' OR post_status='draft') ORDER BY tP.orderby direction