Title: My loop is duplicating, i&#039;m totally stuck please help me out
Last modified: August 20, 2016

---

# My loop is duplicating, i'm totally stuck please help me out

 *  [jamkaret](https://wordpress.org/support/users/jamkaret/)
 * (@jamkaret)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/my-loop-is-duplicating/)
 * Hi.
 * I have been learning wordpress for quite a while now and i decided to start experimenting
   with the loop. Right now i’ve come to a point where i’m stuck and the codex didn’t
   help me out as well.
 * Can anyone please check my loop code that i use for my index.php file and tell
   me where i went wrong? Right now my posts are being duplicated on the second 
   page (i choose to display only 3 blog posts on the blog page)
 * Here’s my loop code: [http://pastebin.com/WXTy29qG](http://pastebin.com/WXTy29qG)
   
   Much appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/my-loop-is-duplicating/#post-2628264)
 * possibly caused by using the query without the ‘paged’ parameter;
 * try:
 *     ```
       <?php $main_query = new WP_Query('cat=-25&paged='.get_query_var('paged')); ?>
       ```
   
 * or alternatively:
 *     ```
       <?php global $query_string; $main_query = new WP_Query($query_string.'&cat=-25); ?>
       ```
   
 * [http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note](http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note)
   
   [http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters)(
   contrary to the note in the last link, try with ‘paged’, if this does not work,
   try ‘page’)
 *  Thread Starter [jamkaret](https://wordpress.org/support/users/jamkaret/)
 * (@jamkaret)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/my-loop-is-duplicating/#post-2628271)
 * Thanks that seems to do the job!
 * I have read the pages from your links already, tried almost everything and nothign
   seemed to work.
 * In addition to my query, i got it from here: [http://digwp.com/2011/05/loops/](http://digwp.com/2011/05/loops/)
   they obviously say
 * > Notice, however, that with WP_Query, we don’t need the $query_string variable
 * So their information is incorrect or?
 * I’m still trying to understand.
 * Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘My loop is duplicating, i'm totally stuck please help me out’ is closed
to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jamkaret](https://wordpress.org/support/users/jamkaret/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/my-loop-is-duplicating/#post-2628271)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
