Archive template for custom post type taxonomy

Hello,

I have a CPT (Custom Post Type) “event” and a non hierarchical taxonomy (tag) for this CTP called “event tag” (slug event-tag).

I’ve made an archive template with these conditions :

If you don’t speak french :
Archive
Post type: categories & tags
Archive terms : All terms (Event tags)

But the archive template is not used…
What could be wrong ?

It works for native posts taxonomies with another archive template with the same conditions applied to native post type :

But not for CPT taxonomy…

To show a list of CPTs in an archive (as you would see a list of posts on a regular blog page) - create an Archive (post type) template.

To show a list of CPTs for the terms (taxonomy) - create Archive (categories and tags) template.

So create both to have the full set.

OK, but I have :

  1. an archive template for native WordPress posts well applied with conditions :
    Archive
    Post type: categories & tags
    Archive terms : All terms (Tags) + All terms (Categories)
    => Commun – IMT

  2. an archive template for CTP event posts not applied with conditions :
    Archive
    Post type: categories & tags
    Archive terms : All terms (Event tags)
    => Live IMT Industrie – IMT
    (the design should be the same as Commun – IMT)

Why the second archive template is not applied ?

My CPT is Projects - but these are the conditions for the two templates I use… One for Archives (for the posts), and one for ‘term archives’ (for the categories).

WP has a lot of ‘built in’ support for POSTS and Categories, which is not there for CPTs and Terms, so you must make it yourself. Also, you must explicitly tell WP to enable archives when you define the CPT and the taxonomy. So make sure you’ve done that too.

For the main CPT POSTS archive:

For the custom taxonomy TERMS archive:

1 Like

It works.

Thanks a lot!

Glad I could help :slight_smile: