Take a look at the Template Hierarchy section of the Codex that concerns Custom Post types.
- archive-{post_type}.php – If the post type were product, WordPress would
look for archive-product.php.- archive.php
- index.php
What you are describing is built in, down to the file naming pattern– archive-cpt.php
To load the same template for all CPT archives use:
function not_post_archive_wpse_107931($template) {
if (is_post_type_archive()) {
$template = get_stylesheet_directory().'/archive-cpt.php';
}
return $template;
}
add_filter('template_include','not_post_archive_wpse_107931');
That will hijack all CPT archives so I would be very careful with it. It could lead to great frustration if someone can’t figure out why a CPT archive is not loading the expected template.
Barely tested. Possibly buggy. Caveat emptor. No refunds.
Related Posts:
- Adding content to archive and taxonomy pages on custom post types?
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Displaying category archive of custom post types
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- $query->set in pre_get_posts is unintentionally affecting the backend
- Setting up custom post type archives in WP3.1? Any luck?
- Filter for “get_post_type_archive_link()”
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- How to show more posts on an archive page?
- Multiple Paginations on one Page
- Create permalink structure for one taxonomy archive per custom post type
- Page is defaulting to archive page and not designated template
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- Display all custom post types in archives.php
- Custom Post Type Archives by Date (stored as meta value) WP3.1
- WordPress custom post type category pagination 404 Error
- Show Custom Post Type by Author
- Custom post type archive with pagination?
- Custom post type tag archives don’t work for basic loop?
- Removing CPT slug from URL results in 404 error for archive page
- Multiple post types in archives (filter?)
- How to let custom post type posts show in standard post archive (like in homepage)?
- Include Custom Posts Type in Year/Month/Date Archive
- where can I see my custom post type archive template?
- Disable single pages and archives and keep preview
- Custom post type archive sorted and grouped by date in post meta field
- Custom post type with tags
- List custom post type but redirects to home page
- Custom-post-type-archive: posts sorted/filtered by year?
- Custom post type archive page pagination
- Custom Post Types and archives
- Need post_type_archive_title function but in ‘single’
- How to get “custom post type”-archive with working permalink to it?
- Hierarchical Custom Post Types – Show only parent on tax archive?
- Custom post types archive redirect
- just can’t get date-based archives per post-type to work
- Archive page for taxonomy terms
- Custom template page with custom archives listing by user
- How can i change the output of posts_nav_link();
- Root slug of taxonomy returning 404
- How to modify archive query with pre_get_posts to append CPTs?
- Custom Post Type with archive page but no detail page
- Change CPT archive title
- How to get post type and month/year before while loop for date.php file
- Custom archive page for CPT UI
- How to display custom post in archive section of the wordpress page?
- The loop seems stuck to a single (now deleted) post
- Archive for CPT
- Custom post type posts don’t show in archive widget
- Archive for a Taxonomy of a Custom Post type
- Archieve.php not loading for custom post type
- Custom Post type & Taxonomy 404
- Return the name of the post type
- Set a hard-coded page-template (post-type-archive) as home/front-page of my wordpress blog?
- Dynamically insert an article at the top of a taxonomy archive – or?
- Archiving custom post content?
- archive as a page, so that it can be added in the wp_menu_nav
- Archive links for custom post types
- Show All Custom Post Types On A Single Archive Page
- Archive Page for Multiple Custom Post Types
- Can’t access private custom posttype single- or archives-page
- Dynamic category name in query post
- How to know which archive page is active
- Archive page for custom post type and custom taxonomy
- Why does my URL keep returning 404 error code?
- Display CPT index page as front/home page
- How to have multiple archive pages?
- Create a Custom Path to Archive
- Advanced archive url structure (category, tag and date)
- Listing authors and date archive from custom post type
- WordPress sitemap with Custom Post Types
- Display all Categories except ones with a specific parent
- Archive per year of a custom post getting the wrong post
- Creating archive like functionality through birectional relationships
- Custom Post Type Archive Page showing as 404
- How to show custom post count in archive page
- Do not show child pages within a file page
- Archive for custom taxonomy
- Custom post type categories giving 404
- Adding Custom Post Types to category/tag/author archives breaks header content
- Custom category taxonomy – archive page not showing up
- How can i remove post type archive URL?
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom taxonomy archive slug overwrites static page
- Want to display my custom date archive to date.php but dont know how
- How can I generate a list of post-type specific categories?
- Custom nav menu current item custom link problem
- date archive future posts
- Keep same archive.php for post from archive?
- archive.php can’t find categorized posts
- archive-{custom_post_type}.php not getting recognized wordpress
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- How can I set up the URL for a category archive for a custom post type?
- ‘Blog Archive’ suddenly appeared on custom post type; how to remove
- Is it possible to remove the word “date” from archives?
- Display results from two Custom Post Types in page template
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Generate daily archive whenever any post type is added
- Stop header code from showing in category page?
- Show custom category archive as front page and remove taxonomy slug from urls