Skip to main content
    Blog docs menuCategory archives

    Turn a blog list into a category archive

    Your Blog page shows every post. A category archive shows only the posts of the category in the address: /category/design/ lists your Design posts, /category/news/ your News. You build it from the same blog list, with three changes in Etch. The pictures use Blog Trento; every EtchwpKits blog list works the same way.

    Blog page or archive

    How a Blog page and a category archive differ
    Blog pageCategory archive
    Where it livesAn ordinary page you createEtch's Category Archive template, used for every category
    What it listsEvery post, newest firstOnly the posts of the category in the address
    Posts per pageThe number on the loopSettings → Reading → Blog pages show at most
    HeadingYour own textThe category's name

    Pasted unchanged into the archive template, a list still shows every post on every category page, under the intro's placeholder headline. That is expected until you make the three changes below.

    Before you start

    • Note your number under Settings → Reading → Blog pages show at most (10 unless you changed it). See The Reading settings.
    • Pagination needs the EtchwpKits Companion plugin, as on your Blog page.
    • Does your site use a page cache? You will purge it at the end.

    1. Paste the list in the template

    In Etch's template manager, under Taxonomies, edit the Category Archive template. Paste the blog list inside main, between your header and footer. Etch uses this one template for every category, so you do this once.

    2. Give the loop the category

    In the structure panel, select the loop Blog List Trento under Posts. The first line in the HTML editor reads:

    {#loop blogListTrento($count: 9) as item}

    Change it to:

    {#loop blogListTrento($count: 10, $cat: term.id) as item}

    term.id is the category in the address, and 10 is your number from Settings → Reading. Type the dollar signs: Etch passes only $count and $cat to the loop.

    Etch editing the Category Archive template. The canvas shows the heading Design and only Design posts. In the structure panel the loop Blog List Trento is selected, marked 1. The HTML editor's first line reads {#loop blogListTrento($count: 10, $cat: term.id) as item}, and the part $count: 10, $cat: term.id is marked 2. (opens the full size screenshot in a new tab)
    Select the loop (1) and add $cat: term.id next to the count (2).

    3. Set the intro on its copy

    Click the intro once, in the canvas or on the Intro Section row in the structure panel. Its properties panel, Intro Section Properties, sets this copy only. Grey values are the defaults showing through until you type your own.

    • Headline: {term.name}
    • Description: {term.description}
    • Show Badge: off, or on with a text of your own in Badge, such as Category
    • Show Description: off if your categories have no description
    Etch with Intro Section selected in the Category Archive template. Below the structure panel, Intro Section Properties shows Show Badge off, Badge Text in grey, Heading Level h1, Headline ID blog-trento-headline, Headline {term.name} marked 1, Show Description on, and Description {term.description} marked 2. Show Badge is marked 3. (opens the full size screenshot in a new tab)
    Intro Section Properties: Headline (1), Description (2) and Show Badge (3) for this copy only.
    The component editor for Intro Section, in purple. The panel has a plus at the top, marked 1, and shows the defaults: Show Badge on, Badge Text, Headline Write a compelling headline., Show Description on and the default description. The canvas shows {props.headline}. Exit and a purple Save button sit at the bottom right, Save marked 2. (opens the full size screenshot in a new tab)
    The wrong place for this: the component editor, with a + at the top (1) and a purple Save of its own (2). These are the defaults of every intro.

    Did it happen? Open the component editor again and put the defaults back:

    • Show Badge: on
    • Headline: Write a compelling headline.
    • Description: Brief, impactful text that complements the headline and drives engagement.

    Click the purple Save, then Exit, and set the archive's values on its copy as above.

    Names and descriptions

    The archive's heading is the category's name exactly as it is written in WordPress, so name it Design rather than design. The description shows under the heading. Edit both under Posts → Categories. The slug, and with it the address, can stay as it is.

    WordPress Edit Category. Name is Design, marked 1. Slug is design. Description reads Notes on layout, type and colour from our studio., marked 2. An Update button sits below. (opens the full size screenshot in a new tab)
    Posts → Categories: the Name (1) becomes the heading and the Description (2) the text under it.

    Save and check

    1. Save the template

      Save the Category Archive template with Etch's usual Save.

    2. Purge the page cache

      A page cache, such as LiteSpeed Cache, keeps showing the old category pages until you purge it. In LiteSpeed Cache that is Purge All in the admin bar.

    3. Open a category on your site

      Open /category/design/, or click a category button on your Blog page. You should see the category's name and description, only its posts, and page links once it has more posts than your Reading number.

    A post type of your own

    Are your posts a post type of your own, such as blog with an archive? Paste the list in that post type's Archive template and pass the type instead of the category:

    {#loop blogListTrento($count: 10, $type: "blog") as item}

    A post type archive has no category, so keep a headline of your own in the intro.

    If it does not work

    Common archive problems and their fixes
    What you seeWhat to do
    Every category page lists all postsThe loop line misses $cat: term.id. See step 2.
    Page 2 shows the same posts as page 1The loop was switched to Etch's Main Query. Switch back to the list's own loop and add $count and $cat as in step 2.
    The heading says Write a compelling headline.The intro was not set on this copy. See step 3.
    Intros on other pages lost their heading{term.name} went into the component editor. Put the defaults back, as under step 3.
    Nothing changes after savingPurge your page cache, then reload.
    The last page numbers are empty or missingThe number on the loop differs from Settings → Reading → Blog pages show at most. Make them the same.
    The count does nothingA dollar sign is missing: write $count and $cat, not count and cat.
    /blog/category/design/ is not foundCategories live at /category/design/ unless you set a category base under Settings → Permalinks. The category buttons always link the right address.

    Still stuck? Contact us with the address of the category page and a screenshot of the loop line.

    Stuck on something? Check If it does not work or contact us. We are happy to help.