[resolved] Full width Page layout (7 posts)

  1. anielsen
    Posted 2 years ago #

    Is there a way to get a single Page to be full width (no widget sidebar) but keep the widget sidebar on the homepage?

  2. Hi there, in the P2 theme, the sidebar include is in the file header.php, on line 48. (Your line numbers may differ if you've made any changes to the theme.)

    To exclude the sidebar on static pages, you could try wrapping it in a conditional tag, so the sidebar only gets included if it's NOT a page. So instead of this:

    <?php get_sidebar(); ?>

    You would have this:

    <?php if ( ! is_page() ):
          endif; ?>

    After you do that you'll also need to make some CSS adjustments to the widths of various elements. You can start by adding this to your child theme:

    #main {
        width: 960px !important;

    (If it works without !important you can remove it.)

    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:


    Let me know how it goes.

  3. anielsen
    Posted 2 years ago #

    I ended up putting this at the top of my Page and it worked:

    #sidebar {width:0;height:0}
    #main {width:950px}
  4. Glad you found something that worked.

    A more standard way to hide an element with CSS is:

    #sidebar {
       display: none;
  5. Just a heads-up that adding styles outside of the head area of a web page isn't recommended. You can put this in a child theme (or CSS plugin) to target the sidebar and main elements only on pages:

    .page #sidebar {
       display: none;
    .page #main {
       width: 950px
  6. Frans Andersson
    Posted 2 years ago #

    Fantastic Kathryn! Thanks.

  7. wpfranner - glad that helped!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic