TutorialDraft

How to build a WordPress hero section with core blocks

Use Cover for text over a photograph or Columns for text beside it. Build either hero in the block editor, then check its colours, mobile layout and image loading.

Browse all 547 patterns

A heading, a short paragraph, a button and a photograph are enough to build a hero section in the WordPress block editor. Use a Cover block to put the words over the picture, or Columns to put them beside it. Neither needs a page builder.

The photograph is usually what makes the choice for you. A quiet landscape can leave room for a heading. A product shot or a busy workshop photograph often needs space of its own, especially if someone else will be changing the pictures later.

This guide builds both versions using Twenty Twenty-Five. Its palette calls the main background and text colours base and contrast; if your theme uses other names, choose the equivalent swatches from its sidebar. For the rest of the page, see how to build a landing page without a page builder.

1. Choose the layout around the photograph#

Cover gives you the familiar full-width photograph with a heading on top. It can work well, but every replacement image needs another check: white text that reads clearly over a dark wall may disappear over a bright sky.

Columns keeps the text on the page background, away from the photograph. You lose the full-bleed effect, but changing the picture is much less likely to affect legibility. It's a useful choice for a client who regularly uploads their own images.

CoverColumns
Text placementOver the photographBeside the photograph
Good fitAn image with clear space for wordsProducts, screenshots and busy photographs
On a phoneThe image crops behind the textThe columns stack
Main compromiseAn overlay can dull the photographThe picture usually sits below the text on mobile

If the photograph needs a heavy overlay before the words become readable, try Columns before spending more time adjusting it. Sometimes the picture and the heading need separate spaces.

2. Build a Cover hero with readable text#

Add a Cover block and select a photograph from the Media Library. Set its alignment to Full width in the toolbar. Using a library image also gives WordPress an attachment it can use to generate responsive image markup.

In the sidebar, work through these settings:

  • Overlay: choose the theme's dark swatch. In Twenty Twenty-Five, that's contrast. An opacity of 60 is a starting point for this example, not a guarantee of readable text.
  • Text: choose the light swatch, base in this theme.
  • Dimensions: set a minimum height in rem, then choose padding from the theme's spacing presets. Leave enough room around the words without forcing a very tall section.
  • Focal point: position it over the part of the photograph you want to keep when the image crops.

Inside the Cover, add a Heading, Paragraph and Buttons block. Use H1 for the heading if the page doesn't already display its main title elsewhere. Choose a heading size from the theme's presets rather than entering a custom size.

The words can be straightforward. For a joinery business, “Oak staircases, made and fitted by one workshop” tells a visitor what the business does. A sentence about measuring, making and fitting can sit underneath, followed by “Ask for a quote”. Add a second button only if there's another useful next step, such as viewing recent work.

Check the button colours separately. Twenty Twenty-Five's usual dark button can get lost against a dark overlay. Give it a base background and contrast text, then check its hover and focus states on the actual page.

3. Build a split hero with Columns#

For a picture beside the words, start with a Group block set to Full width. Give it padding from the theme's spacing presets, then add a Columns block inside it. Set the Columns alignment to Wide and its vertical alignment to centre.

Put the Heading, Paragraph and Buttons in the first column. Put an Image block in the second, selecting the photograph from the Media Library. Set an aspect ratio so an unusually tall upload doesn't stretch the whole section, and write alternative text where the image conveys information.

You can start with equal columns, then give the text more room if the heading wraps awkwardly. Try shortening the heading before making it smaller. A preset size can also preserve the theme's fluid typography, where the theme provides it, so the text scales with the screen.

Keep the words in the first column if you want them first on a phone. Core Columns stacks in source order; putting the photograph first on desktop puts it first on mobile too. Reversing that order at a breakpoint takes extra CSS, which you'll need to maintain alongside the section.

4. Use colours your theme actually defines#

Selecting a palette swatch connects the block to a named theme colour. In Twenty Twenty-Five, a Cover using contrast can follow changes to that preset. A custom value such as #111111 stays the same until you edit the block.

The name still has to exist in the theme. If you copy a section from another site, don't assume its base or contrast means the same thing, or is available at all. Select the blocks and choose from your own palette. The directory colour count explains what to look for in pasted patterns.

The same applies to spacing and type sizes. Presets make later site-wide changes easier, but an unfamiliar preset name isn't a portable design decision on its own. After choosing the settings, switch style variation once and see whether the hero still works.

5. Check the photograph and text on a phone#

A Cover image fills its container by cropping. On a narrow screen, that can remove most of the sides of a landscape photograph. Moving the focal point helps keep the subject visible, but it can't make a wide composition fit a tall space.

Open the page at a phone width and look at what remains. Is the subject still recognisable? Does a bright patch now sit behind the heading? Has the heading wrapped onto so many lines that the buttons are pushed far down the page?

For Cover, treat minimum height as a floor: the content may make the section taller. Avoid relying on a full viewport height to make the desktop version look dramatic, because that height can produce an awkward crop on mobile. If the image won't cooperate, the split layout may be the better use of it.

Check contrast on the rendered page too. WCAG requires 4.5:1 for ordinary text and 3:1 for large text. For text over a photograph, check the lightest or darkest patches behind the words, rather than an average colour from the whole image.

An overlay percentage alone can't tell you whether the text passes. Its result depends on the overlay colour, the text colour and the image underneath. Increase the overlay if needed, or move the words off the image if making them readable spoils the photograph.

6. Check that the hero image loads promptly#

The hero photograph is often the page's Largest Contentful Paint element. If it loads late, visitors can spend the opening moments looking at the space where the main image should be.

WordPress has image-loading optimisations for this, so start by giving it a Media Library image and letting it produce the responsive markup. For Cover, leave Fixed background and Repeated background off unless you need those effects: they use a CSS background, which follows a different loading path from an ordinary image.

Then inspect the published page. Find the hero's img tag and check that it isn't marked loading="lazy" if it's the LCP image. Look for fetchpriority="high" too. A caching or optimisation plugin can change those attributes, so check what the browser receives rather than relying on the editor settings. web.dev's LCP guide explains the loading checks in more detail.

Before you reuse the section, try it with the longest heading and the least cooperative photograph it's likely to receive. Check the phone layout, the button states and another style variation. Those are useful limits to discover while you're still working on a draft.

If you'd prefer a starting layout, the hero section patterns use these same core blocks, and some are in the free collection. You'll still need to check the result with your own words, picture and theme.

Pattern Paste builds hero sections from core blocks and checks them across Twenty Twenty-Five and Twenty Twenty-Four. How we test explains what those checks cover.

From the library

The patterns in this post.

Keep reading.

All 18 articles

9 Themes · 547 patterns · 62 interactive

Your next site, finished sooner.

Start a whole site from a theme, or add one section to the site you have.

Browse themesSubscribe