WordPress.org

Ready to get started?Download WordPress

Forums

Removing sidebar from certain pages (3 posts)

  1. GReddy4u
    Member
    Posted 5 years ago #

    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?

    website

    Appreciate any help...Thanks.

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    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. :)

  3. GReddy4u
    Member
    Posted 5 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic