The main query that runs on archive pages are quite specific to archive pages, and this query is not replicated with a default custom query. As your code stands, your query will retrieve posts according to published date, ie from newest to oldest, and not according to archive.
THE PROBLEM
There are a couple of issues here that I would like to point out. @deflime already pointed out one or two things here, and I would like to repeat it for the completeness of my answer
showposts
andcaller_get_posts
has been depreciated long time ago. They where replaced byposts_per_page
andignore_sticky_posts
respectivelywp_reset_query
is used in conjuction withquery_posts
which should NEVER be used. When usingWP_Query
orget_posts
, you should be usingwp_reset_postdata
The real issue here though, as I said is your custom query. My emphasis, never use a custom query if it is not necessary. And in this case, I can’t see the necessity for a custom query. First of all, you are running two queries here, this is always problematic, as you later need to merge these queries, and this really cause headaches with pagination.
Secondly, you would need to run a complex custom query for this to work. That is why I say, keep to the main query, as your custom query basically does the same exact thing as the main query. These changes you are doing can easily been done with pre_get_posts
. This alters the main query before it is run, so you won’t have any negative impact.
THE SOLUTION
I would suggest to keep to the main query and use the default loop. To split your content they way you are describing it, use a counter. Count the fisrt six posts and do something, and for any other post not within the fisrt six, do something else. I would do something like this
<?php
$counter = 0; //Starts counter for post column lay out
// Start the Loop.
while ( have_posts() ) : the_post();
$counter++; //Update the counter
if($counter < 5){
<---DO SOMTHING FOR FIRST SIX--->
}else{
<---DO SOMTHING FOR OTHER POSTS--->
}
endwhile;
?>
This way, you will not break anything. If you need custom posts per page on your archive page, like I said, use pre_get_posts
to alter the main query
function custom_posts_per_page( $query ) {
if ( $query->is_archive() && $query->is_main_query() ) {
$query->set( 'posts_per_page', 'AMOUNT OF POSTS YOU WANT' );
}
}
add_action( 'pre_get_posts', 'custom_posts_per_page' );