Archives from a block pattern - Verba

Archives and listings Pro
This article covers functionality available to customers on the Pro version.

Build the archive layout once as a block pattern, put a Post Listing block in it, and assign the pattern to every archive in Theme Options. The Elementor route works the same way in a different editor.

#Build it

Create the pattern

In the block editor, build the archive layout as you want it: a header area, your listing, anything else the page should carry. Save it as a pattern.

Add a Post Listing block

Insert the Post Listing block where the posts belong. This is the part that fills with content.

Turn on Archive Mode

In the block's query settings, turn on Archive Mode.

Step three is where everybody gets stuck. Without Archive Mode, the listing runs its own query, so every archive on your site shows the same fixed set of posts.

With Archive Mode on, the listing takes its posts from the page it's on: a tag's posts on a tag page, a category's on a category page, the results on a search page. Only sorting and the post count stay adjustable, and one pattern can serve every archive. Setting up an archive from scratch explains the query behind it.

The Query panel of the Post Listing block with Archive Mode on, leaving only the sorting and count settings
Archive Mode on in the block's query settings.

Everything else about the block works as usual. See Listing settings and query and Customizing the look of a listing.

#Assign it

Go to VerbaTheme OptionsArchiveGeneral, set Archive Source to Block Pattern, and pick yours under Block Pattern. Switching between the four sources loses nothing: your saved patterns and templates stay where they are.

Archive Source set to Block Pattern, with the Block Pattern picker below it
Assigning a block pattern to archives.

#When it's worth it

A pattern pays off when the archive needs a layout you can't assemble from settings, or when you already work in the block editor.

If everything you want is available in Advanced archives, use that instead. You maintain a pattern by hand, while settings survive updates on their own.

My pattern shows the same posts on every archive

Archive Mode is off on the Post Listing block inside it. Turn it on. It's the only common failure of this setup.

Can I use a different pattern for one category?

No. Archive Source applies to every archive at once.

Last updated

Was this article helpful?

FIND THE ONE THAT FITS YOUR PROJECT

Import a demo, swap the content, adjust the layout. Modern WordPress under the hood, fast even when the site fills up.