WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] remove sidebar from one page but not rest of site (15 posts)

  1. actionflickchick
    Member
    Posted 4 years ago #

    I have left and right sidebars all throughout my website and like them that way. However, I need more room for the container on one specific page. I need to widen the widen and remove the left sidebar on http://actionflickchick.com/superaction/chick-pics while leaving the rest of my site alone.

  2. Micah Cooksey

    Posted 4 years ago #

  3. Shane G.
    Member
    Posted 4 years ago #

  4. actionflickchick
    Member
    Posted 4 years ago #

    http://codex.wordpress.org/Customizing_Your_Sidebar#Different_Sidebars_Anyone.3F tells me how to add a sidebar, not how to remove one.

  5. Micah Cooksey

    Posted 4 years ago #

    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:

    <?php
    /* 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.

  6. actionflickchick
    Member
    Posted 4 years ago #

    Okay, http://actionflickchick.com/superaction/shop/ 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.

  7. Micah Cooksey

    Posted 4 years ago #

    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.

  8. actionflickchick
    Member
    Posted 4 years ago #

    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.

  9. actionflickchick
    Member
    Posted 4 years ago #

    Here's the code for the custom page template. Exactly how do I widen the http://actionflickchick.com/superaction/shop/ container (the section with the merch info) by the space I saved when I removed the left sidebar?

    [Moderated]

  10. Micah Cooksey

    Posted 4 years ago #

    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.

  11. actionflickchick
    Member
    Posted 4 years ago #

    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 http://actionflickchick.com/superaction/shop/ 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.

  12. Micah Cooksey

    Posted 4 years ago #

    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 :D

  13. actionflickchick
    Member
    Posted 4 years ago #

    Okay, thanks.

    Soooooooo back to the question: Can anybody else tell me how to widen the container at http://actionflickchick.com/superaction/shop/ 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.

  14. lilith70
    Member
    Posted 4 years ago #

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

  15. lilith70
    Member
    Posted 4 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic