Title: The loop will not loop
Last modified: August 19, 2016

---

# The loop will not loop

 *  Resolved [piology](https://wordpress.org/support/users/piology/)
 * (@piology)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/the-loop-will-not-loop/)
 * Hi!
 * What I want is pretty easy. I have a page which shall simply display the loop(
   all entries). I spent hours reading the documentation. There it says that
    `<?
   php if (have_posts()) : while (have_posts()) : the_post();?>` should do the job.
   It did not. From other places I basically learned I have to kind of initiate 
   it. So I added the following above:
 *     ```
       <?php $args=array(
           'posts_per_page' => 2
         );
         $wp_query = null;
         $wp_query = new WP_Query($args); ?>
       ```
   
 * This now works as expected. Well, not quite. I also have the link for previous
   entries displayed. This appends /page/2/ to the URL of my page. But it does not
   do what it should do. I assume it has to do with what I entered above.
 * So what’s wrong? Where is the simple documentation for: “How to display the loop
   in a page?”
 * Thanks
    pi

Viewing 1 replies (of 1 total)

 *  Thread Starter [piology](https://wordpress.org/support/users/piology/)
 * (@piology)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/the-loop-will-not-loop/#post-1795248)
 * Adding the following seems to do the job:
    `'paged' => $paged,`
 * pi

Viewing 1 replies (of 1 total)

The topic ‘The loop will not loop’ is closed to new replies.

## Tags

 * [the-loop](https://wordpress.org/support/topic-tag/the-loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [piology](https://wordpress.org/support/users/piology/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/the-loop-will-not-loop/#post-1795248)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
