How can I get the actual $first_ids to display first and then show $second_ids. With this code, it still orders them. Not sure what they are ordered by, I am guessing Wordpress defualt sorting?
What I am trying to achieve is that I added the tag "Featured" to all posts inside a custom post type "aircraft-refueling" and I want to display all the "Featured" posts first and then show the rest of the posts.
<?php
// first query
$first_ids = get_posts( array(
'fields' => 'ids',
'posts_per_page' => '999',
'post_status' => 'publish',
'post_type' => array('aircraft-refueling'),
'tag' => 'featured'
));
// second query
$second_ids = get_posts( array(
'fields' => 'ids',
'posts_per_page' => '999',
'post_status' => 'publish',
'post_type' => array('aircraft-refueling'),
'tag__not_in' => array('592')
));
// merging ids
$post_ids = array_merge( $first_ids, $second_ids);
// the main query
$query = new WP_Query(array(
'post_type' => 'aircraft-refueling',
'post__in' => $post_ids,
'paged' => $paged
));
?>