Title: Extending the loop on single.php
Last modified: March 17, 2017

---

# Extending the loop on single.php

 *  Resolved [Niclas](https://wordpress.org/support/users/najclas/)
 * (@najclas)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/extending-the-loop-on-single-php/)
 * Hi!
    I’ve been struggling with this one issue where I want to extend the loop
   on my single.php showing all following posts after the selected one.
 * My first thought was to just increase the post number on single.php showing 9999
   posts, but that obviously did not work since it showed them all,but started on
   the latest one – where I want to show the selected post followed by the rest.
 * I’m using the good ‘ol `<?php while (have_posts()) : the_post(); ?>` to initiate
   the loop without any other settings added.
 * I was thinking about adding a second loop, but not entirely sure how to do that
   since I want it to be the posts following the “current” one..
 * Any help will be madly appreciated.
 * Thanks
    /Niclas

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

 *  [mdshak](https://wordpress.org/support/users/mdshak/)
 * (@mdshak)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/extending-the-loop-on-single-php/#post-8925733)
 * Hi,
    I would suggest to refer this [article ](https://www.smashingmagazine.com/2009/06/10-useful-wordpress-loop-hacks/)
   for WordPress Loop. It will help you sure. Thanks Mohammad
 *  Thread Starter [Niclas](https://wordpress.org/support/users/najclas/)
 * (@najclas)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/extending-the-loop-on-single-php/#post-8926009)
 * That helped a lot, thank you mdshak!
 *  [mdshak](https://wordpress.org/support/users/mdshak/)
 * (@mdshak)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/extending-the-loop-on-single-php/#post-8926243)
 * Hi,
    Glad 🙂 to help you. Its my pleasure. Thanks Mohammad

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

The topic ‘Extending the loop on single.php’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 2 participants
 * Last reply from: [mdshak](https://wordpress.org/support/users/mdshak/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/extending-the-loop-on-single-php/#post-8926243)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
