Categorized | Tips, Tutorials, WordPress

Creating A Custom WordPress Page - Removing Sidebar and Footer

Late last year i decided to start a mini forum where theme and plugin developers could submit their work if they wanted it to be featured on this blog,the idea to start came because i have been receiving quite a bunch of emails from theme designers who wanted their theme(s) to be listed here, so i started the “submit” section and it’s doing the job right now.

One thing that i did do with the “Submit” page is that i gave it a custom page, you will notice on that page that i have removed the footer and sidebar, this is not a hard thing to do, in fact you can find all the info you need at the WordPress Codex.

However to save you some time here’s a quick look at how you too can create a custom WordPress page:

1. The Page File

In you theme folder (/wp-content/themes/your-theme) you should have a file called

page.php

This is the file that is used to display your WordPress Pages, but since were looking to create a custom page we need to take some elements from the page.php file and add it into a new file.

2. Creating a new file for your custom page

Now what you need to do is create a new php file, you can do this with a text editor or if your using Cpanel just choose “create a new file” and let’s call it custom.php (you can call it anything you want) and in that file you MUST add this code at the very top:

That is basically the code to indentify your custom page, once your done with that just copy and paste all the codes from your page.php file into your custom.php file.

3. To Remove Sidebar and Footer

Removing the sidebar and footer from your custom page is as easy as identifying and removing, here’s what you need to find:

< ? php get_sidebar(); ? >

< ? php get_footer(); ? >

Once you have spotted that to line of codes all you have to do is delete it.

4. Implementing your Custom Page

What you need to do now is to implement your custom page, just go into your WordPress admin interface and select

Manage >> Pages

Choose the page you want to edit and you will see a “page template” box on the right, from the dropdown choose “custom” and save your file.

That’s it, you now have a custom page without sidebar and footer, like i said earlier this is just a quick look at the page template function, you should read the codex to get a comprehensive look at the pages template, some people would want to have their content stretch a little wider to compensate the space left by the sidebar and you can do that via your CSS file.

I’ve also created a custom.php file for download in case your too lazy to do it yourself ;)

Download Here

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related posts:

  1. WordPress Plugin - Category Page
  2. Custom Login Design with the BM Custom Login Plugin
  3. WordPress Plugins - WP Custom Title Colour Plugin & WP Digi Clock Plugin
  4. Tip: Creating Unique Content On Every WordPress Tag And Category Page
  5. Tips for de-cluttering your sidebar

14 Comments For This Post

  1. Snap Says:

    there is no “page template” option under “write page” :S

  2. Moses Says:

    @Snap - There’s always the “page template” in Write Page, what version of WordPress are you using?

  3. dreed Says:

    how do i take this a step deeper and instead of removing the sidebar call a custom sidebar in the custom layout? I tried creating sidebar_custom.php and stripping it of all the content i wanted out and then uploaded it to correct folder and then obviously in my custom.php calling to the new sidebar_custom.php. the error i got was:
    Fatal error: Call to undefined function: get_sidebar_custom() in

  4. Mike Says:

    Great tip…thanks! Don’t forget after step 3 you need to upload the custom.php file to your server. Then it will appear in Wordpress. Thanks again!

  5. Trenchfoot Says:

    Thanks for this tip!
    Was very useful for adding my spreadshirt shop to my website.

    Trenchfoot
    http://www.whatwouldjesusbrew.org

  6. Mark Voce Says:

    Thanks, great tip. Just what I was looking for.

    http://www.FedUpWithGoogleAdWords.com

  7. HK Says:

    why even after removing that famous line, the sidebar is still there ?

  8. Sydney Web Design Says:

    hi yes i get the same error, even when i remove get_sidebar() the sidebar still appears.

  9. ben Says:

    Almost worked, but it messed up the bottom of the page footer. Maybe I need to change the code a bit.

  10. Leanne Says:

    Hey this could be very useful for me, thanks :)
    One thing - I notice that on step 2 where it says “you MUST add this code at the very top:”
    Below this, I noticed that the code box is empty. :P

  11. Steve O'Sullivan Says:

    Thanks for the tip. As you mentioned, I want to have my content on the custom pages fill the space where the sidebar was. Any tips on how to edit the css to accomplish this?

  12. Srikrishna Says:

    This one helped me a lot.. thanks ..

  13. Alex Says:

    Hi,

    I am new to all this, but I am having the same problem. But it appears that the box following the words “you MUST add this code at the very top:: is… empty.

    To be sure, I can see the code in all other boxes. Could you help, please?

  14. Kate Says:

    Then how do you make the content wider on that page?

2 Trackbacks For This Post

  1. E-Pembelajaran » Blog Archive » Forum is UP Says:

    [...] Then I make a custom template for the forum’s page.  Tutorial here [...]

  2. Create A Custom Wordpress Page with Different Template | Evil Genius TV | Small Business, Internet Marketing, Product Development, and Business Strategy - from INSIDE the "guru" world Says:

    [...] Here’s the link to the site where I found the solution. Creating A Custom WordPress Page - Removing Sidebar and Footer [...]

Leave a Reply

-->