Title: About subpages
Last modified: August 19, 2016

---

# About subpages

 *  Resolved [loauy](https://wordpress.org/support/users/loauy/)
 * (@loauy)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/about-subpages/)
 * Dear members,
 * I hope this finds you well,
 * I have the following sequence of pages
 * Computer (parent)
    –child– Windows –child– Linux –child– Mac –child– Dos –child–
   Lindows
 * I want to add benefit script to my theme display all brothers pages of current
   page
 * for example,
 * if i’m on Windows page, script should display
    Windows,Linux,Mac,Dos,Lindows
 * if i’m on Mac page, script should display
    Windows,Linux,Mac,Dos,Lindows
 * if i’m on Dos page, script should display
    Windows,Linux,Mac,Dos,Lindows
 * etc ….
 * I want the code which give me what I need 🙂
 * I hope that I can explain what I need
 * I hope you to help me
 * Loauy

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

 *  Thread Starter [loauy](https://wordpress.org/support/users/loauy/)
 * (@loauy)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/about-subpages/#post-1863564)
 * No any one can help me !!!!!
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/about-subpages/#post-1863570)
 * What you’re looking for is a way to render a list of “sibling pages”, ie. they
   share the same parent..
 *     ```
       <?php
       $parent = 1; // Update this to the ID of the top level(parent) page
       wp_list_pages( "parent=$parent" );
       // http://codex.wordpress.org/Function_Reference/wp_list_pages
       ?>
       ```
   
 * You’ll get a list of pages that share that parent.
 * If that’s not what you’re aiming for please provide more details about where 
   this code is being placed and whether it’s going inside [the loop](http://codex.wordpress.org/The_Loop)..
   and when this list of pages should appear(on all sibling pages regardless of 
   parent, or just this particular set)..
 *  Thread Starter [loauy](https://wordpress.org/support/users/loauy/)
 * (@loauy)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/about-subpages/#post-1863574)
 * ^^ Thank you Mark,
 * This code exactly which I need 🙂
 * But my question now, how to automatically get parent page id ??
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/about-subpages/#post-1863576)
 * Well that depends where you’re calling the code, inside the loop, you can use`
   $post->ID`.
 * Eg.
 *     ```
       wp_list_pages( "parent={$post->ID}" );
       ```
   
 * The curly braces just make it easier to read inside syntax highlighting programs,
   but are not required, so this will essentially work just the same…
 *     ```
       wp_list_pages( "parent=$post->ID" );
       ```
   
 *  Thread Starter [loauy](https://wordpress.org/support/users/loauy/)
 * (@loauy)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/about-subpages/#post-1863577)
 * many thanx for your reply Mark,
 * I used
 * `wp_list_pages( "parent=$post->ID" );`
 * for my code and it works correctly 🙂
 * thank you very match …
 * Now I can put this post’s stat as resolved ^_^
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/about-subpages/#post-1863579)
 * You’re welcome.. 🙂

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

The topic ‘About subpages’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 6 replies
 * 2 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/about-subpages/#post-1863579)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
