# Master/Child Pages in PGWP

**URL:** https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897
**Category:** Pinegrow WP
**Created:** [May 18, 2018, 12:39pm UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897 "2018-05-18T12:39:45Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![texxsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/texxsmith/32/1201_2.png) [@texxsmith](https://forum.pinegrow.com/u/texxsmith)
#### Post date: [May 18, 2018, 12:39pm UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/1 "2018-05-18T12:39:46Z")

</div>

My home page will be drastically different from my archive, 404, single, etc pages. It’ll probably have the same menu.  
Do I use a second master pages for all the pages except the home page?

If so, how?

sorry for the noob questions.

---

<div class="post-metadata">

### Author: ![Printninja](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/printninja/32/1181_2.png) [@Printninja](https://forum.pinegrow.com/u/Printninja)
#### Post date: [May 19, 2018, 3:31am UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/2 "2018-05-19T03:31:04Z")

</div>

If you’re not using a significant number of common elements on all your pages, do you really need a master page? Just wondering? I haven’t yet tried to use the Master Page feature.

---

<div class="post-metadata">

### Author: ![texxsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/texxsmith/32/1201_2.png) [@texxsmith](https://forum.pinegrow.com/u/texxsmith)
#### Post date: [May 19, 2018, 8:57pm UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/3 "2018-05-19T20:57:08Z")

</div>

It’s seems it’s required by PG. when making WordPress websites anyway…

---

<div class="post-metadata">

### Author: ![jonroc](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/jonroc/32/2805_2.png) [@jonroc](https://forum.pinegrow.com/u/jonroc)
#### Post date: [May 21, 2018, 7:19pm UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/4 "2018-05-21T19:19:48Z")

</div>

If your header and footer will the the same the most direct route would be to create a front-page.html page and use your current master page as it’s master page. Just make sure your “the\_content” div (in your master page) is set to editable area so you can remove/add what ever you need on the new front-page.html file.

---

<div class="post-metadata">

### Author: ![texxsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/texxsmith/32/1201_2.png) [@texxsmith](https://forum.pinegrow.com/u/texxsmith)
#### Post date: [May 21, 2018, 8:26pm UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/5 "2018-05-21T20:26:51Z")

</div>

Now that I’m getting into it a little more it seems that PG, when making wordpress websites anyway doesn’t really do the traditional “propogate changes to child pages” thing…

True? Or am I just missing it?

---

<div class="post-metadata">

### Author: ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)
#### Post date: [May 22, 2018, 8:26am UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/6 "2018-05-22T08:26:22Z")

</div>

The solution is to use Define Master Page.  
It will allow you to **create additional master pages** for your theme.  
Each new master page will have its own header and footer (page name will be used as a slug for header and footer) and will not use the bits from the main master page.

![define_master_page](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/0/0c1ba12e57342a305446b2230075472986d8a08c.jpg)

**Note** : With Pinegrow, defining a “master page” is our way to allow you to easily “create” (automatically or by using the Site content action) the header and footer parts which are needed in any guidelines compliant WordPress theme.

---

<div class="post-metadata">

### Author: ![texxsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/texxsmith/32/1201_2.png) [@texxsmith](https://forum.pinegrow.com/u/texxsmith)
#### Post date: [May 22, 2018, 1:17pm UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/7 "2018-05-22T13:17:13Z")

</div>

Thanks for chipping in now. I think get it.

---

<div class="post-metadata">

### Author: ![dcneuts](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/dcneuts/32/1173_2.png) [@dcneuts](https://forum.pinegrow.com/u/dcneuts)
#### Post date: [May 23, 2018, 10:44pm UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/8 "2018-05-23T22:44:59Z")

</div>

You can also setup secondary pages using PG and PHP, so for instance, if you do pagination and they go to pages 2+, then they’ll see something different. Just a thought.

Came back to edit this real quick… sorry, tired, didn’t think I just dropped this without explanation, and maybe @Emmanuel may have some feedback that’s more elegant.

For example, I added a function for an alternate template in my functions.php file:

```
function inner_index( $template ){
	if ( is_home() && is_paged() ){
		$alternate_template = locate_template( 'inner.php');
		if(!empty( $alternate_template ))
			$template = $alternate_template;
	}
	return $template;
}
add_filter('template_include','inner_index');

```

Then, in my main loop on index.php, I checked the box to have the parms to to their own block for the array, so I could manually edit them, and included the $paged reference so that WP would know which page it was on, specifically, so that it didn’t get lost in the loop:

```
<?php
            	$paged = ( get_query_var( 'paged') ) ? get_query_var( 'paged') : 1;
                $blogmain_args = array(
            	'post_type' => 'post',
            	'post_status' => 'publish',
            	'posts_per_page' => '5',
            	'paged' => $paged,
            	'order' => 'DESC',
            	'orderby' => 'date'
            )
        ?>
        <?php $blogmain = new WP_Query( $blogmain_args ); ?>

```

So then, I just go into my loop parameters, as I need it for the site I’m working on. At the end, I can use it _with_ the pagination by doing this:

```
<?php wp_bootstrap_pagination( array(
                        	'custom_query' => $blogmain,
                        	'previous_string' => '<span class="fa fa-angle-double-left"></span>',
                        	'next_string' => '<span class="fa fa-angle-double-right"></span>'
                    ) ); ?>

```

I hope this is helpful to you if you ever wanted to try and use inner pages that have different layouts to display loop data. This is the code from my own developer’s blog I built for small business owners. I also set it up with a split/continued loop due to layout breaks, also. Just things I’ve picked up after doing this full-time for a few years, plus I’m still in a training program through my state for military veterans. If you ever get stuck, the Codex is an awesome resource, and I access it on the desktop through Zeal. It’s been helpful, passing it along!

I’ll put a link in the Slack channel to this, they may also find it useful. Definitely use it as an example of how to do this with your own infrastructure as needed, and look up what I’ve done on Codex (break it down). It just takes time, this is a lot of muscle memory and just repetition.

---

<div class="post-metadata">

### Author: ![texxsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/texxsmith/32/1201_2.png) [@texxsmith](https://forum.pinegrow.com/u/texxsmith)
#### Post date: [May 24, 2018, 1:51pm UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/9 "2018-05-24T13:51:33Z")

</div>

Thanks, this way past what I’m trying to do right now. But in the future the sky’s the limit so who knows.

---

<div class="post-metadata">

### Author: ![schpengle](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/schpengle/32/238_2.png) [@schpengle](https://forum.pinegrow.com/u/schpengle)
#### Post date: [May 27, 2018, 11:37am UTC](https://forum.pinegrow.com/t/master-child-pages-in-pgwp/1897/10 "2018-05-27T11:37:31Z")

</div>

Thanks for that helpful tutorial there. That may come in handy for others too now that it is here. Great. Its beyond my pay scale at the moment but I will look at it again in the future.  
I was just saying thanks for the _heads up_ on _Zeal_ too! I had never heard of that, I am currently using _Dash_ , unpaid as of yet, just waiting for the delay to pass when using it, as an otherwise fully functioning document reader. So cheers for that. Also, I no that Dash let Zeal use some of their docsets! thats nice of them 🙂
