How to remove duplicates sticky entries to WP?

Good time.

There's a cycle:
$args = array(
 'category__not_in' => array(1, 13, 14, 15, 18),
 'post_type' => array('post'),
 'publish' => true,
 'paged' => get_query_var('paged'),
 'posts_per_page' => 10,
);

query_posts($args);

 while ( have_posts() ) : the_post();
 get_template_part( 'content', 'shortpost' );
endwhile;

wp_reset_postdata();
 navigation();


There are 2 sticky entries that appear first. But they're wrong. On the main 11 posts instead of 10, and on the second page - re-displays the sticky tape. What could be the reason?
June 10th 19 at 15:32
1 answer
June 10th 19 at 15:34
$sticky = get_option( 'sticky_posts' );
$args = array(
 'category__not_in' => array(1, 13, 14, 15, 18),
 'post_type' => array('post'),
 'publish' => true,
 'paged' => get_query_var('paged'),
 'posts_per_page' => 10,
 'ignore_sticky_posts' => 1,
 'post__not_in' => $sticky
);

query_posts($args);

 while ( have_posts() ) : the_post();
 get_template_part( 'content', 'shortpost' );
endwhile;

wp_reset_postdata();
 navigation();
This code disables the sticky record. This is not an option. It is necessary that the records are there. The problem is that on the main output 11 posts instead of 10, and on the second page - take one of the sticky entries. - Kay.Boyl commented on June 10th 19 at 15:37

Find more questions by tags WordPress