Removing sidebar from certain pages
When I first created my site I attempted to create a simple site for our store using wp. So I’m needing to remove the sidebar from all pages except the home, how would I go about that without messing up each pages style? And on the pages without sidebars, would “page” part be a full page size or only half still?
Appreciate any help…Thanks.
I’m needing to remove the sidebar from all pages except the home
Looks like you’re using a static page for your front page, yes? If so, copy your theme’s page.php file and rename it “homepage.php”. Edit the file and, at the very top, add:
<?php /* Template Name: Home Page */ ?>
then save the file.
Edit your front page and use the Page Template box to select “Home Page” then update the page. Next, edit page.php and remove references to
<?php get_sidebar();?>. That will take the sidebar of all static pages except the home page.
If you want to remove the sidebars from archive and single post pages, you’ll need to remove references to
<?php get_sidebar();?>from single.php & index.php. And perhaps category.php & archive.php if you have the latter 3 template files.
And on the pages without sidebars, would “page” part be a full page size or only half still
Initially still half. You’ll almost certainly need to make further changes to pull the content area out to the full width on underlying pages. But just take 1 step at a time. Once the sidebars have been removed, the design can then be re-assessed. This won’t be a minor job. 🙂
Thanks for the reply 🙂
I was messing with it and figured out how to remove the sidebar and change the width of content to 100% of the page, but I suppose I’ll have to edit the images or just remove them all together. Which I’m guessing I can just go into the images folder and play around until the right ones are removed, which should be a fun headache
- The topic ‘Removing sidebar from certain pages’ is closed to new replies.