Title: Subpages within the loop?
Last modified: August 20, 2016

---

# Subpages within the loop?

 *  [antonysastre](https://wordpress.org/support/users/antonysastre/)
 * (@antonysastre)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/subpages-within-the-loop/)
 * Hi,
 * Anyone have a good solution to fetching subpages to a page when in the loop?
 *     ```
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
             <div class="left">
               <h2><?php the_title(); ?></h2>
             </div>1
   
             <div class="right">
               .. here be children of this page ..
             </div>
       <?php endwhile; endif; ?>
       ```
   

The topic ‘Subpages within the loop?’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [antonysastre](https://wordpress.org/support/users/antonysastre/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/subpages-within-the-loop/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
