WordPress.org

Ready to get started?Download WordPress

Forums

How do I change Sidebar Background color twentyeleven theme (4 posts)

  1. hartmutnz
    Member
    Posted 1 year ago #

    I need to change the sidebar color in twentyeleven. Tried solutions offered before in old threads, no luck. It only changes the widget box color.. I need the whole sidebar in grey all the way down to the bottom. Anyone tried this and successfully changed it? I know its in CSS somewhere..

  2. lyndabanks
    Member
    Posted 1 year ago #

    I have the same question but in twentytwelve -- how to creat background color for sidebar.

  3. invot
    Member
    Posted 1 year ago #

    You will have to edit your theme files to accomplish this. Go to Appearance -> Editor and select Page Template. You should see <?php get_sidebar(); ?> somewhere in the file.

    Wrap this in a div:

    <div id="sidebar">
    <?php get_sidebar(); ?>
    </div>

    Then, go to your stylesheet and enter in something like this:

    #sidebar {
    background:#eeeeee;
    float:left (or right);
    display:block;
    width:30%;
    height:100%;
    padding:10px;
    }

    You may have to adjust those values, but the general idea is there. Wrap your sidebar content in a div and style it.

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Uh oh, three good reasons not to edit the theme's files;

    • You'll compromise the theme.
    • Your modifications will be compromised when the theme updates.
    • Debugging becomes a whole lot harder.

    You can either create a Child Theme or use a Custom CSS Manager plugin to hold your modifications. The plugin only allows CSS modifications, which may be more suitable for you guys.

    Edit: You could probably get away with the CSS;

    #secondary {
     background: red;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic