• Resolved druhl

    (@druhl)


    Hi all.

    New (1 month) WP user, using Cerauno theme (really like that its sidebars are on the right).

    Because on mobile Sidebar 1 displays first under the Posts and Sidebar 2 next, I have my “more important” items in Sidebar 1 so mobile users don’t have to scroll as far down to see them.

    Unfortunately Sidebar 1 is set narrower than Sidebar 2, and I would like to essentially reverse their relative widths – Set SB1 to SB2’s width and vice-versa.

    Is this easily possible?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi there,

    This CSS should switch the widths for those two sidebars on screens that are wide enough to show all three columns:

    @media screen and (min-width: 1101px) {
      div#secondary.widget-area.sidebar-left {
        width: 20%;
      }
      div#tertiary.widget-area.sidebar-right {
        width: 14%;
      }
    }
    Thread Starter druhl

    (@druhl)

    That seems to have done the trick, thank you very much!

    Thread Starter druhl

    (@druhl)

    Actually I do have a question – I notice there is a fair sized “gutter” between the Posts column and the two sidebar columns.

    On mobile of course these just align vertically.

    But for desktop, I guess I could increase those percentages for the sidebars a bit and tighten the gutters a bit? Or should the values of 20% and 14% be kept as some best practice?

    Thanks again.

    Sure. Replace that code with this instead:

    @media screen and (min-width:1101px) {
      div#secondary.widget-area.sidebar-left {
        width:20%;
        margin-left: 2%;
      }
      div#tertiary.widget-area.sidebar-right {
        width:18%;
        margin-left: 2%;
      }
    }

    The default margin is 3.75% in both cases. For the left sidebar, just modifying the margin value will automatically make the column wider, but for the right sidebar you’ll need to reduce the margin and at the same time increase the width, so feel free to play around with those values until it looks the way you want.

    Personally I wouldn’t go any smaller than 1.5% on the margins – with that margin you’ll be able to go up to 19.5% on the right sidebar width.

    @media screen and (min-width:1101px) {
      div#secondary.widget-area.sidebar-left {
        width:20%;
        margin-left: 1.5%;
      }
      div#tertiary.widget-area.sidebar-right {
        width:19.5%;
        margin-left: 1.5%;
      }
    }
    Thread Starter druhl

    (@druhl)

    Again, thank you very much, including for the detailed explanation.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adjust Sidebar widths or switch them’ is closed to new replies.