Support » Theme: Twenty Twelve » Custom Page With No Sidebar

  • Resolved Jose B

    (@linkaq)


    Hi!

    I don’t want my About page to show the sidebar.

    I’m assuming I’ll have to create a custom page template for this.

    Could someone kindly remind me how to go about doing so?

    Thank you very much.

    Website: AfterTheHeadline.com

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jose B

    (@linkaq)

    Anyone? =/

    You can do it with just some CSS. Each page has a unique identifier that allows you to target CSS against elements just on that page. Add this to the end of your child theme’s style.css file:

    .page-id-79 #secondary {
       display: none;
    }
    @media screen and (min-width: 600px) {
       .page-id-79 #primary {
          width: 100%;
       }
    }

    The first rule hides the sidebar on the About page, the second rule expands the width of the main content to cover the space left by the sidebar.

    Thread Starter Jose B

    (@linkaq)

    Thanks a lot CrouchingBruin!

    For anyone who reads this, you don’t need that last } in your code.

    I left the empty sidebar space there, but thanks for the thorough CSS.

    For anyone who reads this, you don’t need that last } in your code.

    Actually, you do. You always need to have the same number of right braces as left braces, i.e., each left brace has to match up with a right brace. If you take off the last }, then the media query isn’t going to work because there will be no closing brace for it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Page With No Sidebar’ is closed to new replies.