wrong template for page of archive

Take a look at the “Template Hierarchy” Codex page.

Custom Post Type Archive display

Template file used to render the Archive Index page for a Custom Post Type. [emphasis added]

By my reading, that means that the archive-{cpt_slug}.php template is only used for the page that, by default, lists all posts of that post type in reverse chronological order. I think what you’re seeing, at least in terms of the template being used, is the correct expected behavior.

If you want to use a different template—either the archive-cpt.php file or a different specifically for your date-based queries—then you should look into the template_include filter that lets you change which template WordPress uses.

Similar versions of this question have been asked already, so check those out for more help:

Leave a Comment