I have been working on a site the past few weeks and ran in to a little bit of a problem that I am sure lots of us had had before.

I am using WordPress and have designed every thing and set up all my sidebars just the way I want them and just at the end of the project the client

says to me that they want a few pages to be shown with out the sidebars. . . . So I did a little searching and this is by far the best way I have found to do this.

 

STEP 1:

In your theme folder make a file called

page-wide.php

STEP 2:

At the top of the file add this -

<?php
/*
Template Name: Wide Page
*/
?>

STEP 3:

Now add in all the code from your “page.php” under that

STEP 4:

Remove the side bar code and give the containing div a extra class or change the id, I just added “wide” to it.

and save the file.

 

STEP 5: Go to the page in the admin panel that needed the code removed and you will see there is a extra “Page Attribute” called “Template

Template Wide View

Template Wide View

 

Here you will be able to pick the new “wide page”  Template and have just that page go off of the new code.

Pick “wide page” and save.

 

That is all there is to it, now I have to do a few things for the css but all in all it saved a lot of time and this is something I will be working in to more themes that I build. :)

 

The key here is this page of code,

 

<?php
/*
Template Name: Wide Page
*/
?>

I also made a file called page-small.php and added this to the top.

<?php
/*
Template Name: Small Page
*/
?>


and was able to have a 3rd page to work with. :)

 

Well I hope this helps out others just as it has helped me out and have a great time making fun sites!

James Riter