How do I hide a sidebar/make page full-width?

Related tutorial: Hide or Remove Sidebar from Any Page in WordPress

 

Create a new sidebar and let it replace a target sidebar on some conditions. Even if you don’t add any widgets, it will still replace the target, but it will of course be empty.

In many themes, an empty sidebar will automatically make a page take up the full width, but some themes will instead display a blank space. You should contact the developer of the theme to change this behaviour.

The function is_active_sidebar( 'target-sidebar' ) can be used to determine when a page should take up full-width, as it will return false if a sidebar – or any sidebar that replaces it – is empty.

Was this article helpful to you?