The Loop is repeating my posts twice

[ad_1]

I’m a generally experienced WP developer and so this issue is rather confusing. Normally when I have posts that are repeating too often, there’s an obvious error somewhere. This time, it’s very unclear to me:

In my archive-post-type.php file I have:

`<?php`
`get_header(‘clean’);`
`?>`
`<?php`
`if ( have_posts() ) {`
`while ( have_posts() ) {`
`the_post();`
`get_template_part( ‘template-parts/content’, get_post_type() );`
`} // end while`
`} // end if`
`?>`
`</main><!– #main –>`
`<?php`
`get_footer();`

This produces duplicates. In other words, instead of seeing one post, I see two. I can not tell why.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer