How to make content of Twenty Twenty-Five theme full width

Modern WordPress block based (full site editing) themes, such as Twenty Twenty-Five theme typically come with support for the .alignwide and .alignfull CSS classes.
Content can be made to span the full width of the page by applying “Align full” to a root level block.

The .alignwide and .alignfull classes only function in the correct contexts and you rarely need to apply them manually – the blocks that support it have a control on the block toolbar (Align) to change the alignment value:

Alignment options on block toolbar

Recommended prerequisites

It’s useful to enable the “Always open List View” option under block editor preferences that can be accessed from the top right corner:

Block editor "Preferences" menu item in the block editor top right corner three dots menu Toggling "Always open List View" option in Block Editor preferences modal under "General" tab

You can then open the List View from the top left corner of the editor and it will always stay open:

List View toggle button in the Block Editor

It shows a useful overview of what blocks are on the page and which one is currently selected:

List View in the Block Editor showing Paragraph and Quote blocks

Without having the list view open it’s a lot more confusing to work with the block editor – you should only keep it closed when using a tiny screen.

Enabling the Top toolbar option is a personal preference – I find it better to have it enabled so the toolbar is always in the same place, rather than changing location based on which block is currently selected.

Block editor "Top toolbar" menu item in the block editor top right corner three dots menu under "View" section

Full width content on a page or post

For this example, let’s edit a Page and make a Paragraph block full width:

A paragraph in the block editor with sample page content

To make it easier to see, here’s the paragraph with a background color applied:

A paragraph with a yellow background in the block editor with sample page content, block settings sidebar is visible with the Color -> Background option set to yellow

The paragraph has already seemingly escaped the “container” – this is because when the paragraph has a background color it also receives padding and the TT5 theme uses the default CSS box-sizing value of content-box – most CSS frameworks and resets tend to override that value to border-box in which case the paragraph would look like this:

A paragraph with a yellow background in the block editor with sample page content, paragraph is aligned with the rest of the content

How ever there is actually no “container” element here, all the content is given a maximum width, and left/right margins are set to auto which centers it. So technically, to make this paragraph “full width” it would need to have the max-width: none CSS applied to it, how ever this is not how it’s intended to work.

Changing alignment

To apply alignfull to the paragraph, it needs to first be wrapped in a Group block, because Paragraph blocks themselves don’t have alignwide/full options, only text align left/center/right.

Select the Paragraph block and wrap it in a Group, by clicking the Paragraph block icon on the toolbar to transform it:

A submenu originating from Paragraph blocks' icon on the block toolbar showing "Transform to -> Group"

The resulting Group block will have the “Align” option on its’ block toolbar, allowing you to change it to “Full width”:

A submenu originating from Group blocks' "Align" item on the block toolbar, "None" menu item active, "Wide width" menu item inactive, "Full width" menu item highlighted

How ever the Paragraph itself still does not appear to be full width:

A paragraph with a yellow background in the block editor with sample page content, Group block selected in the list view with alignment set to "Full width", the yellow paragraph is almost full width but has whitespace on the sides

This is because while the Group is full width, the nested Paragraph is instructed to use “Content width” in the Group block Layout settings:

"Layout" options section in block settings sidebar showing the "Inner blocks use content width" toggle option with the help text "Nested blocks use content width with options for full and wide widths." - the toggle option is enabled

Simply turn that option off:

"Layout" options section in block settings sidebar showing the "Inner blocks use content width" toggle option with the help text "Nested blocks use content width with options for full and wide widths." - the toggle option is disabled

and then everything inside that particular Group block will no longer have their width restricted:

A paragraph with a yellow background in the block editor with sample page content, Group block selected in the list view with alignment set to "Full width", the yellow paragraph inside the Group block is completely full width with no whitespace on the sides

That’s how most things can be made full width – either by using the “Align” option on the block, or by wrapping the block in a Group block and making that full width, while disabling the “Inner blocks use content width” option.

Full width content in a template by default

Another method to make content full width is to change the current template of the page (or edit the existing template):

Block editor sidebar "Page" options section open showing a submenu of the "Template" option with the menu items: "Edit template", "Change template" (highlighted), "Create new template" and "Show template"

If there is no suitable template, you can click “Create new template” and make a full width template yourself:

A modal with the title "Create custom template", "Name" field with the value set to "Full width", name input's description text "Describe the template..." and 2 buttons - "Cancel" and "Create"

After creating a new template, it inherits the default “Page” template contents, which may look something like this:

Block editor showing a template being edited, List View contains 3 items - Group block (collapsed), Separator block, Group block with 2 children - Group block with Title block as a child and a Content block (selected). Sidebar on the right showing "Content" block's options, "Inner blocks use content width" toggle option is enabled

To make the content full width, you would need to disable “Inner blocks use content width” option on relevant blocks, such as the Content block and the Group block that is wrapping the Title block:

Block editor showing a template being edited, List View contains 3 items - Group block (collapsed), Separator block, Group block with 2 children - Group block (selected) with Title block as a child and a Content block. Sidebar on the right showing "Group" block's options, "Inner blocks use content width" toggle option is disabled

After making the changes, save the template and navigate back:

Navigation bar of the block editor - "Back" button (highlighted) on the left, text "Full width - Template" in the center, hotkey indicator with the text "Ctrl+K" on the right

While the page is using the Full width template, it is not always reflected in the editor due to how TT5 theme is set up (the block editor root container has the .is-root-container and .has-global-padding classes applied which add spacing to the sides):

Block editor showing a page with sample content being edited, the content has whitespace on both sides, in the right sidebar "Page" options are being shown, the "Template" option is set to "Full width" and has a submenu open with the "Show template" menu item highlighted

How ever after enabling the “Show template” option you’ll see that the content is indeed full width:

Block editor showing a page with sample content being edited while also displaying the page header above the content, the content has no whitespace on the sides

When the “Content” block of a template already has the “Inner blocks use content width” option disabled then when editing the page your blocks won’t even show the “Align” option on the block toolbar because they can no longer be aligned granularly. For that reason it’s better to just use a normal template and .alignfull to make things full width when applicable, rather than making a whole new template.

Leave a Reply

Your email address will not be published. Required fields are marked *