Disabling the side-bar issue

I understand how to disable the side-bar widget by editing config.php. Although editing config.php successfully removes the side bar on the page, the CSS class “.col-md-9” remains on the “” element. Not sure what’s going on here. The sidebar is definitely not being generated it’s just the class that needs to be removed.

Any help would be much appreciated.

Thanks.

Disable sidebar in lib/setup.php as is explained here: https://roots.io/sage/docs/theme-sidebar/

.col-md-9 is a CSS class of Bootstrap. It is not related with sidebar display.

The bootstrap class gets dynamically added with the sidebar. The problem is I need the side bar for other parts of the site. Even though the sidebar has been disabled on that page the bootstrap class remains.

Can you provide some code of the context? I Don’t understand how and where is created that CSS class

Sage versions 7.0 and lower (quite old now) use Bootstrap classes on main and aside elements.

@eightyeight are you sure that roots_display_sidebar() is returning false?

It’s easier to help if you post your config.php.

1 Like