get latest 5 posts and a specific post and sort in a specific order

I cannot think of a way of getting the latest 5 posts plus a specific one in a single query without using SQL.

If you don’t mind using two queries, I think this would be an easy way to do what you intend:

//Get the latest 5 posts (which happens to be get_posts default 'posts_per_page' value)
$posts = get_posts();

//Build up an array with the IDs
$latests_posts_ids = wp_list_pluck( $posts, 'ID' );

//Insert the desired ID in the third position
$post_id_to_insert = 1;
$insert_position = 2; //which equals 3 when starting from 0
array_splice( $latests_posts_ids, $insert_position, 0, $post_id_to_insert );

//Get the posts based on the IDs and do not alter their order
$args = array(
    'posts_per_page' => 6,
    'post__in' => $latests_posts_ids,
    'orderby' => 'post__in'
);

$posts = get_posts( $args );

//Parse the posts
foreach( $posts as $post ) :

    setup_postdata( $post );
    the_title();

endforeach;

I’m using get_posts() but you can safely use WP_query instead.

WordPress already handles possible duplicates in post__in, which would be the case if the post you want to insert is one of the latest 5.

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