I have been working on a website using WordPress http://1stgoringheath.org.uk/, there are some pages that I didn't want to have the sidebar on, so I made a template and removed get_sidebar

Now I have just a blank area where the sidebar was, which I want to remove and allow the main content div fill the space.

The pictures below show the empty space

With Sidebar

Without Sidebar

How can I fill the empty space where the sidebar was?


Links to page.php and style.css are below https://drive.google.com/file/d/1aVTgmO9uuJtbXlofDeS-bDSxsRawj2vd/view?usp=sharing https://drive.google.com/file/d/1pV6OW5b0WlipUrs0fAWZAXBcLoR1_n14/view?usp=sharing


You may add this code to your custom CSS :

.page-template-pageWithOutSidebar .entry-header, .page-template-pageWithOutSidebar .entry-content {
    padding-right: 0;
| improve this answer | |

Within the parent container of the section whose left margin has to be removed add a class= "row ", and then in the child div element class = "col - * - 12"; , and then put * as md or sm or anything as required.

| improve this answer | |

You can only remove the blank space by editing the custom css. First you need to be working on a Child's theme to ensure your theme's update do not reverse your changes. Then find the main class and set the width to 100%. A link to your website can help us give you further assistance

| improve this answer | |
  • A link is in the original post – Benjamin Broadbent Nov 26 '17 at 9:54
  • Where would the custom css go would it be in the edited template, or the style.css – Benjamin Broadbent Nov 26 '17 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.