Title: Create pages without sidebar &#8230;
Last modified: August 18, 2016

---

# Create pages without sidebar …

 *  [pfigg](https://wordpress.org/support/users/pfigg/)
 * (@pfigg)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/)
 * I want to create a few pages with the main site page as the parent. No problem
   with this …
 * – is it possible to create these secondary pages minus, the sidebar? I need the
   full area within my standard K2 theme in order to design pages with large sized
   technical diagrams.
 * Thanks.
 * -ptfigg.

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

 *  [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * (@pizdin_dim)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/#post-526062)
 * This is one way of doing it: in your “page.php” file, change the line at the 
   bottom that says:
 *  `<?php get_sidebar(); ?>`
 * with this:
 *  `<?php if ($wp_query->post->post_parent == 0): ?>`
    `<?php get_sidebar(); ?>``
   <?php endif; ?>`
 * You should also change the column class at the top that says:
 *  `<div id="content" class="narrowcolumn">`
 * with this:
 *  `<?php if ($wp_query->post->post_parent == 0): ?>`
    `<div id="content" class
   ="narrowcolumn">` `<?php else: ?>` `<div id="content" class="widecolumn">` `<?
   php endif; ?>`
 * Because you’re using a fixed-width layout, you may have a little more “fun” than
   you originally anticipated, getting it to work precisely.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/#post-526066)
 * Isn’t about 100 times simpler to have a separate Page template?
 *  Thread Starter [pfigg](https://wordpress.org/support/users/pfigg/)
 * (@pfigg)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/#post-526070)
 * Thanks guys,
 * moshu, can you elaborate?
 * -ptfigg.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/#post-526071)
 * I don’t need to. The Codex is doing a pretty good job: [http://codex.wordpress.org/Pages#Page_Templates](http://codex.wordpress.org/Pages#Page_Templates)
 *  [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * (@pizdin_dim)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/#post-526080)
 * > _“Isn’t about 100 times simpler to have a separate Page template?”_
 * No, you’re way off with your estimate. It’s only a little bit simpler. And even
   then, it’s debatable. With a separate page template, you still have to put in
   the changes I suggested. Then, on top of that every “sub-page” you create, you
   have to specify that new tamplate. What I suggested does that automatically for
   every sub-page.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/#post-526085)
 * _Then, on top of that every “sub-page” you create, you have to specify that new
   tamplate. _
    You should read the documentation and learn WP before making untrue
   statements like this…
 * And with a Page template you don’t need to mess with conditional tags, which 
   is always easier for non-techie users.
 *  [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * (@pizdin_dim)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/#post-526091)
 * > _“You should read the documentation and learn WP before making untrue statements
   > like this.”_
 * I have. And you shouldn’t assume that I haven’t. Perhaps you misunderstood me?
   Let me give you an example of how I understand it:
 * 1. You create a page template called “parentpage.php”, which WP recognises as
   a template because you have `"<?php /* template name: parentpage */ ?>"` in the
   header.
 * 2. You create another page template called “childpage.php”, which WP recognises
   as a template because you have “<?php /* template name: childpage */ ?>”` in 
   the header.
 * The two template files are only different in that “parentpage.php” has a sidebar
   and “childpage.php” does not.
 * Every time you create a top-level page (no parent), you specify “parentpage” 
   as the template. Every time you create a sub-page (parent exists), you specify“
   childpage” as the template.
 * That’s one way to get **no sidebar** on secondary pages. Another way is to just
   modify the existing “page.php” (if your theme has it) as I already suggested.
 * If you read the original post again, I think you’ll find what I suggested is 
   actually **less error prone** because the template itself determines if it’s 
   going to show the sidebar. The author doesn’t have to remember to select a “childpage”
   template. The downside to my approach is that you can’t specify that you want
   a sidebar on some of your secondary (sub) pages.

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

The topic ‘Create pages without sidebar …’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * Last activity: [19 years, 2 months ago](https://wordpress.org/support/topic/create-pages-without-sidebar/#post-526091)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
