• Resolved thaploeg

    (@thaploeg)


    Hi there,

    I want to create some pages with a sidebar and some pages without on my website https://hoejehetziet.nl

    Therefore a created a page-template (a copy of page.php, which I called no-sidebar.php) and put this in my Child Theme. I excluded the ‘get_sitebar’ from in this template.

    The problem is: when I use this template it works, but the page content is not displayed at full width. There’s simply a white area instead of the sidebar.
    I tried to change this in the CSS file (using a Childtheme), but I didn’t succeed. I tried to add the following code:

    ‘.no-sidebar .content-area {
    ‘ float: none;
    ‘ margin: 0;
    ‘ width: 100%;
    ‘ }

    This didn’t work. The only thing that works is the following code:

    ‘.content-area {
    ‘ float: none;
    ‘ margin: 0;
    ‘ width: 100%;
    ‘ }

    But this results in a full width on all pages, so there is no sidebar visible at any page (even those who do contain a sidebar).

    I’ve very little experience with php and webdevelopment, but hopefully anyone can help me with solving this issue.

Viewing 1 replies (of 1 total)
  • Thread Starter thaploeg

    (@thaploeg)

    Hi again,

    I just solved my own issue. It turned out that I had to place the following code in my CSS:

    ‘@media screen and (min-width: 56.875em) {
    ‘ .page-template-no-sidebar .content-area
    ‘ {
    ‘ float: left;
    ‘ margin-right: -100%;
    ‘ width: 100%;
    ‘ }
    ‘}

    In which “no-sidebar” is the name of my own made template.

    So, problem solved

Viewing 1 replies (of 1 total)
  • The topic ‘Full width in case no sidebar [Twenty Sixteen]’ is closed to new replies.