How to Remove or Customize the Sidebar in Twenty Sixteen
Content
Many users of the popular Twenty Sixteen theme find themselves wanting to adjust the sidebar's behavior. Whether you want to hide it on specific pages, remove it from mobile views, or change its position, this guide covers the most common and effective methods based on community solutions.
Why Isn't There a Built-in Option?
Unlike some themes, Twenty Sixteen does not include a built-in visual option in the WordPress Customizer to toggle the sidebar on or off for different pages. The theme's description refers to an "optional" sidebar because its display is controlled by whether or not you add widgets to it. If the sidebar widget area is empty, the theme automatically applies a .no-sidebar CSS class and adjusts the layout to be full-width. This is the theme's built-in method of making the sidebar optional.
Common Solutions for Sidebar Control
1. The Widget Method (Removing the Sidebar Sitewide)
The simplest way to remove the sidebar is to empty the widget area. This method is best if you want to remove the sidebar from your entire site.
- Navigate to Appearance > Widgets in your WordPress dashboard.
- Locate the "Sidebar" widget area.
- Remove all widgets from this area by dragging them out or deleting them.
Once all widgets are removed, the theme will hide the sidebar and expand the content area to full width.
2. The CSS Method (Hiding the Sidebar on Specific Pages)
To hide the sidebar on specific pages while keeping it active on others, you can use CSS. This is a non-destructive method that preserves the sidebar's functionality.
- Go to Appearance > Customize > Additional CSS.
- Use the following code snippet, replacing
123with your actual page ID. You can find a page's ID by editing the page and looking at the URL (post=123).
.page-id-123 .sidebar {
display: none;
}
You can chain multiple page IDs together:
.page-id-123 .sidebar,
.page-id-456 .sidebar {
display: none;
}
3. The CSS Method for Mobile/Tablet Views
To remove the sidebar only on smaller screens, use a CSS media query. This is a common request as the sidebar can use valuable screen space on mobile devices.
@media (max-width: 768px) {
.sidebar {
display: none;
}
}
4. The Child Theme Method (For Advanced Layout Changes)
For more permanent and complex changes, such as creating a full-width page template, creating a child theme is the recommended best practice. This ensures your modifications are not overwritten by theme updates.
- First, create a child theme for Twenty Sixteen.
- In your child theme's
functions.phpfile, you can add code to conditionally add a.no-sidebarclass to the body tag on certain pages (e.g., everything except the blog homepage).
function mychildtheme_body_classes( $classes ) {
if ( ! is_home() ) {
$classes[] = 'no-sidebar';
}
return $classes;
}
add_filter( 'body_class', 'mychildtheme_body_classes' );
- Then, in your child theme's
style.cssfile, add the corresponding CSS rule:
.no-sidebar .sidebar {
display: none;
}
5. Moving the Sidebar from Right to Left
To swap the sidebar and main content positions on larger screens, use the following CSS in the Additional CSS section or your child theme's stylesheet.
@media screen and (min-width: 56.875em) {
.content-area {
float: right;
margin-right: 0;
}
.sidebar {
float: left;
margin-left: 0;
}
}
Troubleshooting Common Issues
- Footer moves up on short pages: When you remove the sidebar, a page with little content can cause the footer to appear too high. You can add a minimum height to the content area using CSS to push the footer down:
#content { min-height: 550px; } - Double sidebars: If a second sidebar appears below your content on single posts, it is likely the "Content Bottom" widget area, not the main sidebar. You can hide it with CSS (
.sidebar-content-bottom { display: none; }) or manage its widgets under Appearance > Widgets. - Code doesn't work: Always ensure you are adding CSS to the Additional CSS section or a child theme. If another CSS rule is overriding yours, you may need to add
!important(e.g.,display: none !important;), though this should be used sparingly.
By following these community-tested methods, you can effectively gain control over the Twenty Sixteen sidebar to create the exact layout you need for your website.
Related Support Threads Support
-
Hide right sidebar on selected pagehttps://wordpress.org/support/topic/hide-right-sidebar-on-selected-page/
-
How to remove logo, top menu, sidebar optinhttps://wordpress.org/support/topic/how-to-remove-logo-top-menu-sidebar-optin/
-
How to show fullwidth, no sidebar on front page but have sidebar on single postshttps://wordpress.org/support/topic/how-to-show-fullwidth-no-sidebar-on-front-page-but-have-sidebar-on-single-posts/
-
Extra sidebar showing on comment page to each post, underneathhttps://wordpress.org/support/topic/extra-sidebar-showing-on-comment-page-to-each-post-underneath/
-
Remove Sidebar From Mobilehttps://wordpress.org/support/topic/remove-sidebar-from-mobile/
-
Remove Sidebar Based On Viewport Widthhttps://wordpress.org/support/topic/remove-sidebar-based-on-viewport-width/
-
Help with page template/no footer widgets with sidebar?https://wordpress.org/support/topic/help-with-page-templateno-footer-widgets-with-sidebar/
-
Sidebar issuehttps://wordpress.org/support/topic/sidebar-issue-56/
-
full width with sidebarhttps://wordpress.org/support/topic/full-width-with-sidebar/
-
Remove side bar from all pages expect blog/home pagehttps://wordpress.org/support/topic/remove-side-bar-from-all-pages-expect-blog-home-page/
-
removing sidebar some pageshttps://wordpress.org/support/topic/removing-sidebar-some-pages/
-
customising twenty sixteen themehttps://wordpress.org/support/topic/customising-twenty-sixteen-theme/
-
How do you remove the sidebar?https://wordpress.org/support/topic/how-do-you-remove-the-sidebar/
-
Moving sidebar from right to left – how?https://wordpress.org/support/topic/moving-sidebar-from-right-to-left-how/
-
can I have two types of sidebar?https://wordpress.org/support/topic/can-i-have-two-types-of-sidebar/
-
Removed sidebar makes page too shorthttps://wordpress.org/support/topic/removed-sidebar-makes-page-too-short/
-
Additional Left Sidebar in Place of Auther, date, tabhttps://wordpress.org/support/topic/additional-left-sidebar-in-place-of-auther-date-tab/
-
Do not show sidebar in single!https://wordpress.org/support/topic/do-not-show-sidebar-in-single/
-
Optional sidebarhttps://wordpress.org/support/topic/optional-sidebar-2/
-
Full width template with sidebarhttps://wordpress.org/support/topic/full-width-template-with-sidebar/
-
optional right sidebarhttps://wordpress.org/support/topic/optional-right-sidebar/
-
How to make pages without the sidebar?https://wordpress.org/support/topic/how-to-make-pages-without-the-sidebar/
-
Sidebar From Right to Lefthttps://wordpress.org/support/topic/sidebar-from-right-to-left-3/
-
page templates- full width for frontpagehttps://wordpress.org/support/topic/page-templates-full-width-for-frontpage/