Skip to content

How to Add a Container in WordPress?

[rank_math_breadcrumb]

Table of Contents

Every page is really a stack of sections: a header band, a feature row, a call to action. The container is the thing that makes a section a section.

The Container block wraps whatever you put inside it and gives you control over its width, its layout, its spacing and its background.

Before You Start

  • Edition: Free — works in Nexter Blocks (free) and with Nexter Blocks Pro.
  • Block to enable: Container, switched on under Nexter > Blocks in your WordPress dashboard.

Video Tutorial

How to Add Flexbox Container in WordPress – Full Width & Boxed Layout.

Steps

  1. Add the Container block to your page.
Adding the Container block
Nexter Blocks Container editor: Choose a Container Layout, Flexbox presets
Adding the Container block: pick Flexbox or Grid, then a column preset.
  1. Choose how the content inside should be laid out — a flex row or column, or a grid.
Nexter Blocks Container editor: Layout panel with Content Width, Width, Container Width and Height
The Layout panel: Content Width (Boxed or Full), width, height and gutter.
  1. Set the width: boxed, wide or full.
Nexter Blocks Container editor: Flex Property panel with Reverse switched on, columns shown in reverse order
Flex Property with Reverse on: the two columns swap places.
  1. Set the padding and margin that give the section its breathing room.
Nexter Blocks Container editor: Extra Options panel with Wrapper Link, Overlays and Sticky
Extra Options: Wrapper Link, Overlays and Sticky.
  1. Add a background — a colour, an image, or one of the Pro effects.
Nexter Blocks Container editor: Inner Container selected, Layout panel with Column Width and Min Height
Inner Container Layout: Column Width and Min Height.
  1. Drop your content blocks inside it.
Nexter Blocks Container editor: Inner Container Flex Property panel
Inner Container Flex Property: direction, alignment, gap and wrap.
  1. Publish and check the section at desktop, tablet and phone widths.
Container block, Background panel in the Style tab
Nexter Blocks Container editor: Inner Container Extra Options with Wrapper Link and Sticky Column
Inner Container Extra Options: Wrapper Link and Sticky Column.

How It Behaves

The container renders a wrapper with an inner element, and your layout choices are written onto it as classes.

  • Measured on a published page: a default container rendered tpgb-container-row with an inner tpgb-cont-in, plus the width class tpgb-container-wide.
  • Grid layout is a class on the parent. Measured: choosing grid added tpgb-grid to the container, and each child container carried tpgb-container-inline. See the grid container guide.
  • Containers nest. A container inside a container is the normal way to build a row of columns inside a section.
  • Responsive settings are per breakpoint, so a row on desktop can become a column on a phone without duplicating the section.
  • Measured with Nexter Blocks Pro deactivated: the container itself still renders. It is a free block.

What Needs Pro

The container, its layouts, its spacing and a plain colour or image background are free. The background effects and sticky behaviour are not. Each of these was measured with Nexter Blocks Pro deactivated and vanished completely from the published page:

Limitations

  • Nesting has a cost. Containers inside containers inside containers make a page that is hard to edit and slow to reason about.
  • Full width is not always full width. A theme with its own page wrapper can constrain the container regardless of the setting.
  • Spacing set only at desktop applies everywhere. Generous desktop padding becomes cramped or wasteful on a phone unless you set it per breakpoint.
  • Backgrounds sit behind everything inside. A busy background under text is a readability problem no setting will fix.

Troubleshooting

My container is not full width

Set the width to full and check the theme is not wrapping the page in its own constrained container. Some themes need a full-width page template as well.

The content inside is not lining up

That is the layout setting. A flex row aligns along one axis, a grid along two — see the grid container guide.

It looks right on desktop and wrong on mobile

Set the layout and spacing at the smaller breakpoints too. Desktop values are inherited downwards unless you override them.

My background effect does nothing

Two things to check. Every background effect needs Nexter Blocks Pro — measured, they render nothing without it. And the effect settings only take hold once you have chosen the background type that owns them.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!