Setting up an archive from scratch

Tutorial 7 min read

You open a category page, it does not look like the demo, and it is not obvious where that is changed. More than one answer is correct, depending on which edition you run and how the site is built.

This page explains what an archive is, then sorts out which route is yours.

This is written for blogs.

Archives matter most on a blog theme, or on the blog part of any of our themes, and that is the case the examples assume. A portfolio, a shop or a directory follows the same underlying rules, with its own content type in place of posts.

#What an archive actually is

An archive is a page WordPress builds for you out of your own content. You never create one, and you cannot delete one: it exists because the content does.

There are several kinds, and they all work the same way underneath.

Category and tag archives

Everything filed under one term. /category/travel/ lists the posts in Travel.

The author archive

Everything written by one person.

Date archives

Everything published in a month or a year.

Search results

Everything matching what somebody typed.

The posts page

Your main blog listing, which is an archive of everything.

#The query, and why it is the important part

When somebody opens /category/travel/, WordPress reads the URL, works out what was being asked for, and runs a database question: give me the published posts in this category, newest first, this many per page. The answer to that question is called the main query, and the archive template's job is to draw it.

Three things follow from that, and they explain most archive confusion.

The URL chooses the posts you see, not the template. One template draws every category, and each category shows different posts because the query differs. That is why there is usually no setting that says "show these posts on this page".

Pagination comes from the query. "Posts per page" under SettingsReading decides how many the query returns, which decides how many pages exist. A theme's own listing setting can override it, and when the two disagree the numbers look wrong.

Ordering is part of the question. Newest first is the default. Anything else is a change to the query rather than to the layout.

The most common archive mistake is a listing with the wrong source.

Any post listing you place on a page has to be told where its posts come from. On an ordinary page you pick a category by hand. On an archive you must set it to follow the current query instead, or every category on the site will show the same fixed set of posts and the archive stops being an archive.

If your category pages all show identical content, this is nearly always why.

Separate two layers early. The archive header, meaning the title, description and image at the top, is a different layer from the list of posts underneath it. They are configured in different places, and people spend a lot of time looking for one in the settings for the other.

#The routes, simplest first

Which of these you have depends on the theme you run and whether the Pro plugin is active. Check your theme's own documentation for which route it offers, because this differs between themes more than anything else on this page.

The free or base edition, in the Customizer

Archives are configured under AppearanceCustomize: layout, card, number of columns, header. The limit is no custom listings, no zones and no per term settings. This is a complete, working archive, and it is the same one for every category.

Theme settings, with Pro

The route for most sites that have it. One set of settings drives every archive at once, with no pages to assemble by hand, and Pro is generally where per term settings, extra layouts and the demo-built archives live. This is the recommended starting point when it is available.

Block patterns

When an archive should differ from the rest and the site is built in the block editor. This is the route that gives you arbitrary composition.

A page builder template

Where the theme supports one. It gives the most freedom and the most to maintain by hand.

Take the highest route that solves your problem.

Each step down gives you more freedom and more places you will have to maintain by hand, so dropping a level should be a decision rather than a habit.

#The base archive and the Pro archive are two different things

This explains a lot of "why does mine look different". The Pro plugin adds capability the base edition does not have, so the same theme can produce two different archives depending on what is installed. Screenshots in a demo were almost always taken with Pro active.

What your license actually coversThis page is about what you bought and what its limits are. Activating it is a separate walkthrough, and this one assumes you have already done that or are deciding before you buy. Start wit...Licensing

#The two composition routes do not mix

A block pattern is built out of blocks and lives in the block editor. A page builder template is built in the builder. They are separate systems, and an archive assembled in one cannot be edited or reproduced in the other.

In practice, a theme built strictly around blocks may have no builder route at all, and on a site where the builder does the assembling, a block pattern is not where the archive will come from. Pick one and stay in it rather than moving an archive between them.

#The part that does not depend on your route

The post listing itself behaves the same everywhere. Learning the listing settings once covers the theme settings, the block, and any builder widget the theme provides.

Not every listing setting is available in every place, and that is not a bug.

Knowing it in advance saves a support ticket, because the missing control is usually one that has nothing to attach to in that particular surface.

#Practical advice

The category description comes from the term itself, under PostsCategories, so a category with no description shows no description however the header is configured.

An empty category renders an empty archive. That is correct behavior, and it looks like a broken page, so check that your terms have posts before debugging the layout.

Settings will not save, or changes are not visibleMost of the time this is a cache, and the value you think did not save is sitting in the database exactly as you left it. The other cases are a real save failure. The two are fixed in comple...Troubleshooting

Pagination is a decision rather than a default: numbered pages, load more, or infinite scroll each suit a different kind of reading.

An archive imported with a demo starts from the demo's own settings rather than from the defaults, so check it against the list of things a fresh import leaves behind before changing anything.

What to check after a demo importThe importer finishes the main work by itself. This page is the review pass, plus the repairs for the handful of things a server, a cache or a third-party plugin can leave half done. Look at...Setup Guide

The same routes decide how the front page is assembled, and the two are usually configured in one sitting.

Building a good homepageStart with the thing almost everybody trips over. It is standard WordPress rather than anything about our themes, and getting it wrong costs an afternoon. Front page, homepage, posts page Th...Tutorial

#Common questions

All my category pages show the same posts

The listing has a fixed source instead of following the archive's own query. Find the source or query setting on the listing and set it to use the current archive, and each category will start showing its own posts.

Can different categories look different?

Per term settings are generally a Pro capability, so on a base edition every archive shares one configuration. Check your theme's documentation for what it offers.

I changed the archive settings and one category ignored them

That category has its own local setting, which beats the global one. That is by design.

My archive shows the wrong number of posts per page

Two settings are competing: SettingsReading and the listing's own count. Whichever one the theme applies last is the one you see, so set both to the same number.

Which route should I start with?

The theme's own settings if you have Pro, because they cover most sites without building anything by hand.

Can I switch routes later?

Yes. The more specific route wins while it exists, so a template built for one archive overrides the settings based configuration until you remove it.

My archive looks nothing like the demo

Check which route the demo used and whether Pro was active in it. An archive assembled as a template cannot be reproduced with settings alone, and the reverse is also true.

#Still stuck

Open a support ticket and say what you tried and where it stopped. Your product, your domain, a screenshot and the exact message you saw are usually enough to settle it in one reply.

Last updated

Was this article helpful?

Related articles

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.