I would like to sort authors by specific name.
This is my code:
$authorname = 'max';
$blog_arr = array(
'posts_per_page' => -1,
'post_type' => 'post',
'orderby' => '(author = "'.$authorname.'") desc'
);
$post_arr = get_posts($blog_arr);
Unfortunately WordPress filters my orderby in the core.
This answers also does not help: SQL Server - Order by case , Ordering by specific field value first, How do I return rows with a specific value first?
Thank you for help. Best regards