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.