Support » Fixing WordPress » Change width sidebar for ONE page

  • Resolved gehaktmolen


    Hi all,

    I know this question the ‘how to change the width of sidebar on one page?’ has been asked before a lot, but the things I found didn’t solve my problem..
    As you can see on my TWENTYFOURTEEN website ( I want the sidebar(= the black background) on the first page to be as wide as the photo. In CSS I tried this:

    .page-id-25 #secondary {width: 838px;}

    But that will only work for the width of the photo. It won’t change the width of the sidebar.. The thing that changes the width of the sidebar:

    @media screen and (min-width: 1080px)
    {.site:before {width: 422px;} }

    But that only works for all the pages. Is there a way to make it wider than 422px only on the first page? I would appreciate your help very much!! Thank you.

    PS: I’m doubting that the black background actually IS the sidebar.. Is it or is it not?
    PSS: Changing the width of the white background(content?) is of course also possible. Any idea how to?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael


    Forum Moderator

    combine the two:

    @media screen and (min-width: 1080px) {
       .page-id-25 site:before {width: 422px;}

    you can also use .home instead of .page-id-25 to target the home page.

    Thanks a lot for your reply! Unfortunately though nothing changes after changing “.site:before” into “.page-id-25 site:before”. This is my full child-CSS:

    @media screen and (min-width: 1080px) {.site:before {width: 422px;}}

    #secondary {width: 422px; padding-left:0;}

    body.home .entry-title {
    display: none;}

    .page-id-25 #secondary {width: 838px;}

    Ik heb ‘m! Je zat dichtbij. Het moest zijn: .page-id-25 .site:before

    Nogmaals bedankt voor je tip 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change width sidebar for ONE page’ is closed to new replies.