Conditional sorting with variable using WP Query

You can put the condition in your select and then use that for sorting.

SELECT ID, post_author = 6 as featured_author
FROM wp_posts
ORDER BY featured_author DESC, post_created DESC

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)