Your second block of code is strange. The use of query_posts()
doesn’t really make sense. I don’t even know what that is intended to do. Additionally, that is not really the best way to exclude posts from a Loop, and is what is causing your 5 vs. 6 posts issue.
You need to exclude the “do not duplicate” post with query arguments.
$args = array(
'posts_per_page' => 6,
'paged' => $paged,
'post__not_in' => $do_not_duplicate,
);
$my_query = new WP_Query( $args );
if ($my_query->have_posts()) {
while($my_query->have_posts()) {
$my_query->the_post();
get_template_part( 'content', get_post_format() );
}
}
What is happening that is causing confusion is that your query returns 6 results but that includes the post you want to exclude. When you exclude that in your Loop, you end up with only 5 posts.