• I’m looking for a way to remove the sidebar on some pages without having to create a new stylesheet. Is there anyway to do it in style.css?

    Cheers

Viewing 5 replies - 1 through 5 (of 5 total)
  • Yes, and it’s not that hard:

    suppose, in your index there are two divs, one called #main, and the other one called #sidebar. These will be in your style.css.

    Now suppose you want to remove the sidebar for pages, then you create only one div in page.php, called #main-single. In style.css you add this id with the appropriate settings, probably width directive larger than the one in #main.

    Peter

    Thread Starter tris1601

    (@tris1601)

    Would that be for all pages then? I’m hoping to do it selectively for some?

    well, you can different themes for different pages, if you like.

    Read about that here.

    Peter

    Thread Starter tris1601

    (@tris1601)

    Actually, thinking about it, I only want it to display on my main page.

    Then you have to change single.php, page.php, archive.php, category.php, and possibly others (all depending on your template hierarchy, of course) to be different than your index.php (or home.php, again depending on your hierarchy).

    Peter

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Removing sidebar for some pages’ is closed to new replies.