How To Remove The Sidebar From A WordPress Page

Many people don’t realize that you can heavily customize how WordPress displays your pages. As an example of this, let’s pretend that you need a page on your site to not display the sidebar (like if you needed to display a large picture or calendar).

There are 3 steps to remove the WordPress Sidebar:

Below I will break down the steps and show you exactly how to make a custom page template that does not display the sidebar.

How to Create a Custom WordPress Template cats zithromax in

naked city avenue blue ft jeff golub mp3 download

This process actually isn’t that difficult. Log into your FTP server and navigate your way to your Theme’s template files. Locate the file called “page.php” and duplicate it. Then rename the copied file something easy to remember such as “custom template one” or something. The name is not important, you just have to remember which one does what.

The custom file is now created. So the next thing we have to do is make a couple changes for it to be different from a regular WordPress page.

Arthur et les Minimoys psp Removing the WordPress Sidebar

Now open the file in your editor of choice (I prefer TextEdit on my Mac). First, you need to name the template for WordPress to read. Add the following code to the top of your new template file:

<!—display code><?php /* Template Name: New Name of template here */ ?><–!>

If copy and pasting it does not work here, it may be easier for you to find this code in a existing template on your own blog. Just change the name of the template and it should work just fine.

Once you’ve done that, it’s time to remove the line of code that calls and displays the sidebar when the page is generated. Look towards the end of the template file for the following line of code (it may be slightly different in your theme, just look for anything with ’sidebar’ in it):

<!—display code><? php get_sidebar(); ?><—!>

Delete that line of code and save the file. Then you must upload it back to your theme directory on your server. The template will no longer pull up the sidebar when a page is displayed using this template.

Turning on Your Custom WordPress Page Template prednisone tapering schedule

Now that your new page template is on the server, you have to edit the page you want to apply the template to in the WP-Admin. In the page edit window, look for the “Attributes” section. You’ll see an option to select a different template. If you followed all the steps, the name you wrote in step two should appear on the list. Select it, save the page. The page is now setup to utilize the custom page template you created.

Go to the page on the live site and make sure the sidebar isn’t there. Now that you know how to customize a page template, you can learn the PHP codes that WordPress uses and develop your own template pages.

Other Uses For Custom Page Templates

Displaying a page without the sidebar is only the beginning of custom page templates in WordPress. You can create templates for category pages, single posts, and archives to name a few. I have utilized page templates for posts to display different sidebars depending on the category of the post. This makes it very simple to display different advertisements based on the category of your post.

Page templates have unlimited flexibility and can take your WordPress blog or website to the next level. Just make sure to back everything up because mistakes can sometimes happen when editing the theme files.

Do you have any clever uses for a custom WordPress page template?