Special Offer: Buy All 48 Premium WordPress Themes for Just $74.99. Learn more

Premium Themes: Remove Sidebar from Pages and Posts

Sometimes, you may want to remove sidebar from your posts and pages. It will require very simple code change. Here are all of the necessary steps:

I. Pages

If you want to remove your sidebar from ALL pages in your website, you’ll have to:

1) Open page.php file

2) replace

<div id=”main-content”>

with

<div id=”main-content-full”>

3) Delete:

<?php get_sidebar(); ?>

4) Save changes and upload file.

II. Single Posts

If you want to remove your sidebar from ALL single posts pages in your website, you’ll have to:

1) Open page.php file

2) replace

<div id=”main-content”>

with

<div id=”main-content-full”>

3) Delete:

<?php get_sidebar(); ?>

4) Save changes and upload file.

Note: If you want to remove the sidebar for some page only, instead of adding the above code changes, you can simply set ‘No Sidebars Page’ template to the page. The ‘No Sidebars Page’ template will display your page excluding the sidebar from it.

About the Author

Tihomir Ivanov is a WordPress web developer, founder of tishonator.com, a fan of Linux and Open Source, a gym enthusiast, a vegan, a fan of minimalism, good movies and books :)

Leave a Reply