Picking a theme is definitely never easy on WordPress, especially when it comes to the WordPress page template. They all have something you want and in some aspect will be lacking a certain element. If you are not ready to dive under the hood to do some modifications you are forced to either choose a different theme or accept the downfalls of the one you are using. In my instance I am going to go ahead and create my own WordPress page template.

WordPress Chunk Theme Full Width TemplateFor my personal blog I am using the Chunk Theme (download) from Automattic which can also be found on sites such as 500 Designs and Uncrunched. The one design that I did not like about this theme was how the page templates were setup.

In the image included I have highlighted the areas in pink that needed to be removed. For pseudo static pages there is really no reason to have a left comment column nor an area for comments. The example of the finished product can be seen on my portfolio page (or any subsequent pages that I add to this blog).

To start with I took a look at the WordPress Codex that dealt with creating your own page templates. Immediately it is explained that I needed to create a template that all my subsequent pages would follow. Since this theme does not have a page.php file, just an index.php, I would need to create my own. I called my file fullwidthtemplate.php, but you can use anything that is easier for you to remember. The first bit of code required is to announce to WordPress that this file is a template and then to retrieve the header.

Now if I were to go into the pages section I will see the Templates drop-down and I could choose my template. So far though this will just give us a white content space and not populate it with the information we put into our pages. We are going to need to cherry pick some of the php code from the index.php file so that what we want populates onto the page. What we need from the index.php file is the entire ‘Contents’ section. This can be copied straight from the editor in the WordPress dashboard.

This code will be placed right into the fullwidthtemplate.php file after the header code. We need to change two parts of the code though before we move on. The first change needs to be the id of the div found on line 1. Currently it is “contents” but we are going to rename it to “contentsfullwidth”.

The second part we need to change is the get_template_part in line 4 to retrieve “contentfullwidth instead of “content”.

Finally we need to tell this file to call our footer so we will add a final php include.

Now we have completed our first file and saved it as fullwidthtemplate.php and it can be uploaded into the proper theme directory on the server (/wp-content/themes/chunk/).

Next step in the process is we need to create a php file that will place the contents we want inside this custom page. So create a new document called contentfullwidth.php (or whatever you decided to put for line 5 above). This is going to be the opening part of the document.

Next in our editor we will open up the content.php file in the WordPress editor and steal this snippet of code from it for our document.

The only line that needs to be changed in this file is line 1. We need to change the div id to mainfullwidth.

This file is complete and can be uploaded to the same directory as before. Next we need to open up the Stylesheet (style.css) in the WordPress editor and add these lines of code to the very end.

These are in relation to the div id’s changed in both the custom php files. They are what tell the main div to take up the entire width of the template and the contents to do the same. The padding can be adjusted if necessary along with any other styles that may need to be added. This simply, is just the layout the divs and they will inherit all other style aspects from the theme.

After all of this is complete you now should be able to create a page and choose this custom WordPress page template so that you have a pseudo static content page without a left column or comments in the footer.