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. Custom Login Design with the BM Custom Login Plugin
  2. WordPress Plugins – WP Custom Title Colour Plugin & WP Digi Clock Plugin
  3. Tip: Creating Unique Content On Every WordPress Tag And Category Page
  4. Tips for de-cluttering your sidebar
  5. CMS Page Tree View Plugin for WordPress

28 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. Faggot33 Says:

    Rottencrotch through her pertty pink panties are over! ,

  5. 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!

  6. Justin Says:

    Thanks, I’ve been looking for that for a long time!

  7. Trenchfoot Says:

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

    Trenchfoot
    http://www.whatwouldjesusbrew.org

  8. Phil Says:

    Hey Snap,

    In your ‘custom.php’ file put this at the top of your code:

    

    This will activate the page template dropdown box on your pages. If it doesn’t work try reactivating your theme. Hope this helps

  9. Mark Voce Says:

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

    http://www.FedUpWithGoogleAdWords.com

  10. HK Says:

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

  11. Sydney Web Design Says:

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

  12. ben Says:

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

  13. 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

  14. Gianna Says:

    This helped me after a bit of tweaking; I had to copy the page code into the custom page downloaded from here, but otherwise, it was fabulous!

  15. 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?

  16. johnny Says:

    step 2 where it says “you MUST add this code at the very top:” is empty

  17. Rotem Says:

    Someone already said it, by maybe you missed it.

    You left the template name php code blank.

    Anyway, I knew how to do it, tried it, but it messes up the page. The contents of the footer apears in the sidebar!

  18. Srikrishna Says:

    This one helped me a lot.. thanks ..

  19. Small Business Says:

    Your blog is so informative … keep up the good work!!!!

  20. Crovaxian Says:

    If you are using a custom theme, it is possible that the “Page template” selection dialog (which may differ depending on version) will not display. This is because your custom template my not have any page templates available.

    If you are still having this problem, switch your theme to the default wordpress theme, and you will see your “Page Template” selection dialogue. If after switching back to your custom template this dialogue disappears, the custom template does not support “Page Template”s.

    Of course this doesn’t mean you can not go in, create your own for that template.

  21. Kopi Tribulusdynamic Says:

    That information is help me so well to create custom page. thank you very much.

  22. cheated Says:

    why are you making someone fool……

  23. Kate Says:

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

  24. Money now Says:

    Thanks for tutorial!!! Great and patience way to explain! 10x . And that file for lazy people make me to create the file ;) Thanks

  25. Alex55 Says:

    Then to the Supreme Court for visits with some of them . ,

  26. 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?

  27. Mehmet Says:

    Thanks you so much, it helped me a lot!

  28. cascd Says:

    i think the missing code could be :

6 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 [...]

  3. Create A Custom Wordpress Page with Different Template | Evil Genius Interactive | JJ Kennedy Says:

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

  4. Best Theme-To Not Look Like a Blog Says:

    [...] website. Add a new page or add a new post. In this case you would be adding pages. You can also remove the sidebar from your theme. This would however require you to make some modifications to the page.php [...]

  5. Is your sidebar doing it’s job? | Web SEO Rank Says:

    [...] Creating A Custom WordPress Page – Removing Sidebar and Footer [...]

  6. links for 2009-03-31 « On New Media Says:

    [...] Creating A Custom WordPress Page – Removing Sidebar and Footer | WPThemesPlugin.com (tags: wordpress themes tutorial custom cms page) [...]

Leave a Reply

-->