最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - remove blank space where sidebar was

programmeradmin2浏览0评论

I have been working on a website using WordPress /, 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?

Thanks

Links to page.php and style.css are below

I have been working on a website using WordPress http://1stgoringheath.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?

Thanks

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

Share Improve this question edited Nov 26, 2017 at 13:19 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Nov 26, 2017 at 9:14 Benjamin BroadbentBenjamin Broadbent 133 bronze badges 3
  • You give us to see two different pages — "with" and "without", "home" and "Contact Us". – Max Yudin Commented Nov 26, 2017 at 9:23
  • can you give us the link of your site ? – Temani Afif Commented Nov 26, 2017 at 9:44
  • 1stgoringheath.uk – Benjamin Broadbent Commented Nov 26, 2017 at 9:46
Add a comment  | 

3 Answers 3

Reset to default 1

You may add this code to your custom CSS :

.page-template-pageWithOutSidebar .entry-header, .page-template-pageWithOutSidebar .entry-content {
    padding-right: 0;
}

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.

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

发布评论

评论列表(0)

  1. 暂无评论