WP Query posts duplication

I have code like this one:

<?php
$args = array (
‘post_type’ => ‘post’,
‘posts_per_page’ => 10,
‘cat’ => ‘1’
);
$latest_news = new WP_Query($args);
while ( $latest_news->have_posts() ) {
$latest_news->the_post();

the_title();
} // end while

wp_reset_postdata();
?>

It’s returning me posts with duplication like this: First Title, Second Title, First Title, Second title, First title, Second title

How can i fix it?

Read more here:: WP Query posts duplication

Leave a Reply

Your email address will not be published. Required fields are marked *