How to Adjust the Content Width in the Twenty Seventeen Theme
Content
A common challenge for users of the Twenty Seventeen theme is the default, narrow content width. Many site owners find that their text, images, and other elements are constrained, leaving excessive empty space on the sides, especially on larger monitors. This can make a site feel unbalanced and limit design possibilities.
Based on numerous community discussions, this issue is not a bug but a deliberate design choice by the Twenty Seventeen team to optimize readability. However, the theme's structure is highly customizable with CSS. The problem often arises because users adjust the main content container but forget to modify related elements like sidebars, images, and front-page panels, leading to inconsistent or broken layouts.
Here are the most effective solutions gathered from the community to help you achieve a wider, more balanced layout.
1. Adjusting the Main Container and Content Area
The primary method for changing the site's width is by targeting the .wrap class, which controls the main container. For a site-wide change, use the following CSS in the Appearance → Customize → Additional CSS panel.
@media screen and (min-width: 48em) {
.wrap {
max-width: 1100px; /* Adjust this value to your preference */
}
}
If you are using a sidebar layout, you will also need to adjust the width of the primary content area and the sidebar to prevent layout issues.
@media screen and (min-width: 48em) {
.has-sidebar:not(.error404) #primary {
width: 67%; /* Increase the content area width */
}
.has-sidebar #secondary {
width: 29%; /* Adjust the sidebar width accordingly */
}
}
2. Making Images and Galleries Responsive
A frequently reported issue is that text widens after applying CSS, but images and galleries remain at their original size. To ensure your media scales with your new content width, add this rule:
.entry-content img {
max-width: 100%;
height: auto;
}
This ensures that images will never exceed the width of their container, making them fully responsive.
3. Fixing the Static Front Page Width
When you set a static front page, Twenty Seventeen applies a unique one-column layout that can appear narrower than other pages. To widen the front page panels, use this specific CSS:
@media screen and (min-width: 48em) {
.page-one-column .panel-content .wrap {
max-width: 1000px; /* Your desired max-width */
padding-left: 0;
padding-right: 0;
}
}
4. Creating Full-Width Pages
For individual pages where you want to remove the sidebar and use the full width of the screen, you must address the .has-sidebar class that the theme might add. The following CSS will force a full-width layout on pages without an active sidebar.
.page.page-one-column:not(.twentyseventeen-front-page) #primary,
.no-sidebar #primary {
float: none;
width: 100%;
max-width: none;
}
5. Troubleshooting Common Problems
- CSS Not Working? Always add custom CSS to the Additional CSS section in the Customizer. Using a child theme's
style.cssis also recommended for sustainability, but ensure you are enqueuing it correctly. - Check for Specificity: The theme's default CSS is very specific. Using
!importantcan sometimes be necessary to override it (e.g.,width: 100% !important;), but use it sparingly. - Browser Cache: After making changes, always clear your browser cache and perform a hard reload (Ctrl+F5 on Windows, Cmd+Shift+R on Mac) to see the changes.
By following these steps, you can successfully customize the width of your Twenty Seventeen theme to create a layout that better suits your content and design preferences. Remember to test your changes on different screen sizes to ensure a responsive design.
Related Support Threads Support
-
I want to change the width of twentyseventeen, but CSS doesn’t workhttps://wordpress.org/support/topic/i-want-to-change-the-width-of-twentyseventeen-but-css-doesnt-work/
-
Custom Post Type Pages Not Showing Fullwidthhttps://wordpress.org/support/topic/custom-post-type-pages-not-showing-fullwidth/
-
Make Front Page Width The Same As Other Pageshttps://wordpress.org/support/topic/make-front-page-width-the-same-as-other-pages/
-
How changing posts widthhttps://wordpress.org/support/topic/how-changing-posts-width/
-
Need to Make Featured/Panel Images Full Width + need padding-right for side menuhttps://wordpress.org/support/topic/need-to-make-featured-panel-images-full-width-need-padding-right-for-side-menu/
-
Updated TwentySeventeen update squashes front page & post widthhttps://wordpress.org/support/topic/updated-twentyseventeen-update-squashes-front-page-post-width/
-
How to increase the width of the post?https://wordpress.org/support/topic/how-to-increase-the-width-of-the-post/
-
2017 theme narrowing down content on parallax front pagehttps://wordpress.org/support/topic/2017-theme-narrowing-down-content-on-parallax-front-page/
-
Different Text width’s on front vs. sub pages – despite common global settingshttps://wordpress.org/support/topic/different-text-widths-on-front-vs-sub-pages-despite-common-global-settings/
-
Static Home page unable to affect width with custom csshttps://wordpress.org/support/topic/static-home-page-unable-to-affect-width-with-custom-css/
-
edit contact form dimensionshttps://wordpress.org/support/topic/edit-contact-form-dimensions/
-
Unable to change Page width like Homehttps://wordpress.org/support/topic/unable-to-change-page-width-like-home/
-
Change body text width in postshttps://wordpress.org/support/topic/change-body-text-width-in-posts/
-
Homepage Widthhttps://wordpress.org/support/topic/homepage-width-2/
-
Narrow text in center columnhttps://wordpress.org/support/topic/narrow-text-in-center-column-2/
-
Insert code o Front-Page.phphttps://wordpress.org/support/topic/insert-code-o-front-page-php/
-
How to change column width on page or posthttps://wordpress.org/support/topic/how-to-change-column-width-on-page-or-post/
-
Apply full width to images on all pageshttps://wordpress.org/support/topic/apply-full-width-to-images-on-all-pages/
-
How to increase the width of the pagehttps://wordpress.org/support/topic/how-to-increase-the-width-of-the-page/
-
Webpage very narrowhttps://wordpress.org/support/topic/webpage-very-narrow/
-
Center and expand pricing tablehttps://wordpress.org/support/topic/center-and-expand-pricing-table/
-
Mix between full with and standardhttps://wordpress.org/support/topic/mix-between-full-with-and-standard/
-
Comment boxhttps://wordpress.org/support/topic/comment-box-47/
-
Widen margins?https://wordpress.org/support/topic/widen-margins-2/
-
Making all pages width pages (80%), not just front pagehttps://wordpress.org/support/topic/making-all-pages-width-pages-80-not-just-front-page/
-
How to make one of the Front Page Sections at full-width ?https://wordpress.org/support/topic/how-to-make-one-of-the-front-page-sections-at-full-width/
-
I have changed the width of the content, but images don’t resizehttps://wordpress.org/support/topic/i-have-changed-the-width-of-the-content-but-images-dont-resize/
-
Wider Posts and Imageshttps://wordpress.org/support/topic/wider-posts-and-images/
-
CSS to change img layouthttps://wordpress.org/support/topic/css-to-change-img-layout/
-
Twenty seventeen won’t go full widthhttps://wordpress.org/support/topic/twenty-seventeen-wont-go-full-width-2/
-
Adjust website container width for theme Twenty Seventeenhttps://wordpress.org/support/topic/adjust-website-container-width-for-theme-twenty-seventeen/
-
Increase Blog post widthhttps://wordpress.org/support/topic/increase-blog-post-width/
-
How to change ‘content_width’ in child-theme via functions.phphttps://wordpress.org/support/topic/how-to-change-content_width-in-child-theme-via-functions-php/
-
Full width graphicshttps://wordpress.org/support/topic/full-width-graphics/
-
Twenty Seventeen Static Home Page Widthhttps://wordpress.org/support/topic/twenty-seventeen-static-home-page-width-2/
-
How to make images fit the main content width?https://wordpress.org/support/topic/how-to-make-images-fit-the-main-content-width/
-
Making pages full widthhttps://wordpress.org/support/topic/making-pages-full-width-2/
-
Article gets narrower and narrowerhttps://wordpress.org/support/topic/article-gets-narrower-and-narrower/
-
Twenty Seventeen Post Page – Content widthhttps://wordpress.org/support/topic/twenty-seventeen-post-page-content-width/
-
Page content width: fine on blog, now not workinghttps://wordpress.org/support/topic/page-content-width-fine-on-blog-now-not-working/
-
Twenty Seventeen: full width screen… how?https://wordpress.org/support/topic/twenty-seventeen-full-width-screen-how/
-
Full Width Pageshttps://wordpress.org/support/topic/full-width-pages-12/
-
text-length for all pageshttps://wordpress.org/support/topic/text-length-for-all-pages/
-
Make images in posts widerhttps://wordpress.org/support/topic/make-images-in-posts-wider/
-
Make gallery page full width?https://wordpress.org/support/topic/make-gallery-page-full-width/
-
Issue with Front page no going full width in conatinerhttps://wordpress.org/support/topic/issue-with-front-page-no-going-full-width-in-conatiner/
-
Full width not working as expectedhttps://wordpress.org/support/topic/full-width-not-working-as-expected/