Title: Parent Page &#8211; PHP Code
Last modified: August 20, 2016

---

# Parent Page – PHP Code

 *  [prionnsias](https://wordpress.org/support/users/prionnsias/)
 * (@prionnsias)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/parent-page-php-code/)
 * Done anyone know the PHP code to do the following
 * I have a bunch of pages that are children of other pages
    what i would like to
   do is have the parent page list each of it’s children in the main body then pull
   a couple of the custom fields from each child page
 * example
 * Parent page is Called “Crew”
    Child page is called “Andrew”
 * on “Andrew” page there is a picture in a custom field and his role on the team
   in another custom field
 * I want the parent page to display the picture of “Andrew” and the role
    then 
   go on and do the rest for all the children pages of “Crew”
 * thoughts?
 * thanks

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

 *  [James Laws](https://wordpress.org/support/users/jameslaws/)
 * (@jameslaws)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/parent-page-php-code/#post-2461656)
 * You would want to create a template page for your parent pages: [http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates](http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates)
 * Then you would want to create a custom query within or after the main query of
   this page template: [http://codex.wordpress.org/Class_Reference/WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query)
 * And then you would want to display any custom meta that you’ve added: [http://codex.wordpress.org/Function_Reference/get_post_meta](http://codex.wordpress.org/Function_Reference/get_post_meta)
 * Hope this helps.
 *  Thread Starter [prionnsias](https://wordpress.org/support/users/prionnsias/)
 * (@prionnsias)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/parent-page-php-code/#post-2461662)
 * Thank you for the quick response
    I will look at those and let you know if i 
   have additional questions

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

The topic ‘Parent Page – PHP Code’ is closed to new replies.

## Tags

 * [parent](https://wordpress.org/support/topic-tag/parent/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [prionnsias](https://wordpress.org/support/users/prionnsias/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/parent-page-php-code/#post-2461662)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
