Title: Fixed sidebar
Last modified: August 21, 2016

---

# Fixed sidebar

 *  Resolved [angius](https://wordpress.org/support/users/angius/)
 * (@angius)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/)
 * This theme got great potential of having the sidebar fixed, it’ll look really
   great.
    But how can I do that? I tried slapping position:fixed in various parts
   of styles.css, but beside breaking the theme – nothing really works…

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/fixed-sidebar-5/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/fixed-sidebar-5/page/2/?output_format=md)

 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425961)
 * Hi there, just a heads-up that the best way to make changes to a theme is to 
   use a child theme, so your tweaks won’t be overwritten when updating the theme.
   Here are some guides in case you haven’t made one before:
 * [http://codex.wordpress.org/Child_Themes](http://codex.wordpress.org/Child_Themes)
   
   [http://op111.net/53/](http://op111.net/53/) [http://vimeo.com/49770088](http://vimeo.com/49770088)
 * Once you have a child theme set up, try adding this to the stylesheet in your
   child theme directory:
 *     ```
       #masthead {
          position: fixed;
       }
   
       #main {
          position: relative;
       }
       ```
   
 * I tested this on my end and it keeps the sidebar in a fixed position while letting
   the main column scroll.
 * Please let me know how this works for you!
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425962)
 * Actually it may also work with only the first #masthead bit. 🙂
 *  Thread Starter [angius](https://wordpress.org/support/users/angius/)
 * (@angius)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425963)
 * It works almost perfectly, thank you very much 🙂
    The only issue is that, the
   elements of the sidebar are a bit too wide, they are wider than actual sidebar.
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425964)
 * You’re welcome! Could you please provide a link to your site so I can take a 
   look, since I’m not seeing that on my test site.
 * Did you make any other CSS changes? The code above shouldn’t change any widths.
 *  Thread Starter [angius](https://wordpress.org/support/users/angius/)
 * (@angius)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425967)
 * [http://angius.hol.es/](http://angius.hol.es/)
    No changes. If I recall correctly,
   of course. I’ll try reinstalling the theme maybe.
 * Edit: After reinstalling the bug is still present.
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425970)
 * Are you making the changes in a child theme or using a custom CSS plugin? My 
   test is using a child theme.
 *  Thread Starter [angius](https://wordpress.org/support/users/angius/)
 * (@angius)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425971)
 * I was doing it on a main theme. But if you’re saying, that it works only on a
   child, I’ll try.
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425972)
 * I’m saying I’ve only tested it on a child theme. 🙂 I don’t recommend modifying
   the theme files directly, since your changes will be overwritten the next time
   you update the theme.
 * Let me know how it goes.
 *  Thread Starter [angius](https://wordpress.org/support/users/angius/)
 * (@angius)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425973)
 * Unless I’m doing something terribly wrong, using the child theme broke my site
   even more…
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425975)
 * Looks like you didn’t upload the styles.css file in your child theme, which is
   required for a child theme to function:
 * [http://angius.hol.es/wp-content/themes/sunspot-child/style.css](http://angius.hol.es/wp-content/themes/sunspot-child/style.css)
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425976)
 * You may want to double-check all the other steps in making a child theme from
   the resources I linked to above – or your preferred tutorial – to make sure everything
   is set up correctly.
 *  Thread Starter [angius](https://wordpress.org/support/users/angius/)
 * (@angius)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425978)
 * Apparently it was a matter of a typo… It works now (child theme, I mean), but
   the elements are still too wide… I even disabled all the widgets, but it looks
   like that’s not the cause…
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425981)
 * Could you try changing the #masthead CSS to this:
 *     ```
       #masthead {
        position: fixed;
        width: 300px;
       }
       ```
   
 *  Thread Starter [angius](https://wordpress.org/support/users/angius/)
 * (@angius)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425985)
 * It works perfectly, why haven’t I thought about this earlier…
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/#post-4425986)
 * Excellent. 🙂

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/fixed-sidebar-5/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/fixed-sidebar-5/page/2/?output_format=md)

The topic ‘Fixed sidebar’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/sunspot/1.1.4/screenshot.png)
 * Sunspot
 * [Support Threads](https://wordpress.org/support/theme/sunspot/)
 * [Active Topics](https://wordpress.org/support/theme/sunspot/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/sunspot/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/sunspot/reviews/)

## Tags

 * [fixed](https://wordpress.org/support/topic-tag/fixed/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * 17 replies
 * 2 participants
 * Last reply from: [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/fixed-sidebar-5/page/2/#post-4425988)
 * Status: resolved