• willjedwards

    (@willjedwards)


    I’m trying to remove the responsive sidebar on my site (it just behaves awkwardly and it’s a single page site anyway) and although I’ve gotten rid of the all the widgets and attempted to remove the sidebar in the editor, it still sticks around, completely empty.

    Here’s the site The Gumball Machine Guide

    Any suggestions on how to remove the sidebar in the editor?

Viewing 4 replies - 1 through 4 (of 4 total)
  • CrouchingBruin

    (@crouchingbruin)

    You don’t want to modify the theme files directly. If the theme gets updated because of feature enhancements, bug fixes, or security patches, or if the theme has to be updated because of a change to the WordPress core, then your changes will be lost. Instead, either create a child theme or use a CSS plugin like Jetpack or Custom CSS Manager. Since what you need to accomplish can be done using just CSS, I would suggest using a CSS plugin rather than creating a child theme. Unless your theme has some sort of custom CSS option, however; in that case, you can use that instead.

    Whichever route you pick, you want to add these CSS rules:

    #secondary {
        display: none;
    }
    #primary {
        width: 100%;
        padding: 0 100px;
    }

    The first rule hides the sidebar and the second rule expands the main content area to fill in the space left by the sidebar. You can adjust the value for padding, which is the amount of empty space between the text and the left & right sides of the content area.

    puhelin09

    (@puhelin09)

    The problem is shown here.

    I have just noticed the lack of the option to suppress the sidebar since 4.2.2 (?) and these instructions looked like the answer to the issue. However, I’ve applied the CSS update and the right hand side (where the sidebar was) is now empty, but the content is not spread across the page. Also, the right side of a Search box, the page title and “nts” (part of “Comments”) appear below the main content.

    I am using vanilla TwentyTen. Previously, as I never want the sidebar, I commented out get_sidebar in twentyten/page.php, but that no longer has the desired effect.

    Any suggestions on how to revert to a user-friendly behaviour would be very welcome!

    Thanks.

    CrouchingBruin

    (@crouchingbruin)

    @puhelin09, you can’t necessarily take the CSS for one theme and use it on a different theme and expect the same results. Theme designers often use different class names or ID for their elements. Second, you shouldn’t directly edit any theme files like page.php, because when/if the theme gets updated, those changes will be lost. The suggested method for making those types of changes is to create a child theme and make your changes to a copy of whatever file you want to modify.

    For Twenty Ten, the sidebar is the element which has an ID of primary, so to hide the sidebar and stretch the main content out to the full width, use this CSS instead:

    #primary {
        display: none;
    }
    #content {
        margin: 0;
    }

    For other questions about the Twenty Ten theme, please post them on the Twenty Ten support forum.

    puhelin09

    (@puhelin09)

    Many thanks for the quick response, CB – as you can see, I’m a novice, but I do have implementation of a child theme on my to-do list. Your change works perfectly. Thanks again.

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

The topic ‘Removing Empty Sidebar’ is closed to new replies.