Support » Fixing WordPress » remove sidebar from one page but not rest of site

Viewing 14 replies - 1 through 14 (of 14 total)
  • tells me how to add a sidebar, not how to remove one.

    In more detail, you’ll want to duplicate your theme’s page.php and name it something like sidebar-right.php. Then add the following at the top:

    /* Template Name: Right Sidebar */

    Then find the code that displays the left sidebar, something like
    <?php (!dynamic_sidebar('Sidebar Top')) : ?> and delete that. You’ll probably have some layout things to tweak so as not to leave a blank space, but you can widen your content area with CSS.

    Okay, now has no left sidebar.

    But how do I widen its WP container? Its width is determined on the stylesheet, not on the page template. I saw where to make the page use a different template, but nowhere to make it use a different stylesheet.

    Ok, so you can use a css class in your page template. So for your container div, you’d have <div id="containter" class="nosidebar">. That way you can use separate styling for the elements on that page. In your CSS file, use #container.nosidebar. The # is for the id, and the . is for the class.

    Thanks for helping.

    I have no idea what you just told me to do with the CSS file. Use #container.nosidebar where, how, and for what? I don’t know squat about CSS.

    Here’s the code for the custom page template. Exactly how do I widen the container (the section with the merch info) by the space I saved when I removed the left sidebar?


    Ok, you did the right thing there. I removed your code because you’re not allowed to paste lots of code in your post. No big deal, though.

    Open your style.css file, and find #container. Copy everything after that in between the {}’s. Then, on a new line, put #container.1sidebar and paste what you just copied. Then, where it says width:XYZpx;, increase that number by one or two hundred pixels. Then just play around with the width until you get it where you like it.

    Okay, style.css has this: #container.1sidebar { [same style info as #container but 200 wider] }

    Even though the 1Sidebar Page Template (page_no_left_sidebar.php) had successfully removed the left sidebar from adding that #container.1sidebar to style.css did not affect the width. I’m still missing some step.

    And thanks for all the input. Much appreciated as we work our way there.

    I’m not good at table-based layouts. Try increasing the width to 900px and changing the float:left to float:right for both the container and right_sidebar. I really don’t have much experience with tables, so maybe someone will have some ideas that doesn’t have to get up from their desk and run in circles screaming for a while after working with that type of layout 😀

    Okay, thanks.

    Soooooooo back to the question: Can anybody else tell me how to widen the container at because we haven’t done it yet.

    Creating 1Sidebar Page Template (page_no_left_sidebar.php) let me remove the left sidebar but we have been unable to alter the container width.

    I’m having the exact same problem. Has anyone come up with a solution? Even my local WP guys are giving me blank stares.

    HEY! I found a solution!

    In my page, I took the instance of id=”content” out of that first div tag in the custom template page, and it works great now!

    Give that a try?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘remove sidebar from one page but not rest of site’ is closed to new replies.