You have to tell WP that archive.php should apply to your custom post type as well as it’s other defaults. You can use pre_get_posts filter to do this, be sure to research this well before using it as there is a right and wrong way to use this filter.
For example, try:
function add_custom_post_type_to_archiving( $query ) {
$query->set( 'post_type', array(
'post', 'custom_post_type_name1','custom_post_type_name2'
));
return $query;
}
add_filter( 'pre_get_posts', 'add_custom_post_type_to_archiving' );
Related Posts:
- WordPress custom post type archive with description
- Is possible register two archive pages for single custom post type?
- Display custom post type archive on page.php template
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Custom Post Type Settings page, choose page to display archive
- How to get the custom post type from an archive page?
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- How do you create an archive for a custom post type from a plugin?
- Proper way of making custom post type landing page or archive page
- Custom Post Type Archives by Date with Custom Permalink
- Loading custom page template via plugin
- Change title in head on Archive page
- Custom Post Type Archives with 0 Posts Redirects as 404
- 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?
- paginate function in archive for custom-post-type
- Custom post type archive sorted and grouped by date in post meta field
- How to create archive page for taxonomy terms within custom post type
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- CPT: archive-cpt.php VS custom page template
- Custom-post-type-archive: posts sorted/filtered by year?
- How to list custom post types?
- Custom post type archive page pagination
- Editable content on a Custom Archive page
- Second Custom Post Type Archive
- is_main_query() not working for WP REST API
- CPT Archive with core Category
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- get the custom post type title/name
- Custom post type is showing custom home page, not archive page
- URL of a custom post type’s post format archive?
- Create template for taxonomy results limited by Custom Post Type
- WordPress post_where & posts_join not working only for custom post type
- Why is my site using index.php instead of archive?
- How to display custom post in archive section of the wordpress page?
- My archive-posttype.php template is not loading
- Custom Post Archive is not working
- What’s the name of the custom post type yearly archive template?
- How can I use archive-{post_type}.php theme template?
- Return the name of the post type
- How to integrate single and archive templates for custom post type in any WordPress theme
- How do I add custom HTML to the content of an archive page’s posts?
- Use the custom post type archive for taxonomies?
- Custom Post Type Archive template not being called
- Archive page for custom post type and custom taxonomy
- How to have multiple archive pages?
- Create a Custom Path to Archive
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- WordPress sitemap with Custom Post Types
- Archive page of CPT’s custom Taxonomy
- Finding the CPT archive template source
- Custom Post type page content (archive page)
- Group custom post type posts by month
- ACF Pro Accessing fields on a Custom Post Type
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Do not show child pages within a file page
- Tell wordpress to show a single page instead of an archive page
- Custom Post Type archive page listing a 404 or single post
- get_permalink() of page the enclosing page not posts
- get first limited words from a custom post in the archive page
- How to display archive by selecting year and then selecting month
- Want to display my custom date archive to date.php but dont know how
- Show index and not the archive for “Dog Custom Post” with default slug
- Custom post type archive page not showing on archive-posttype.php
- Custom post type with two templates
- How do I make my archive page look like popular reviewing sites (e.g., Polygon and Gamespot) [closed]
- Making a archive gallery page for a custom post type which already has an archive page
- Rewriting archive page slug to be different than custom post type slug
- Site loads very slow for archive custom post type page
- Stop Custom post type from being searched via URL
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Custom post type category page not working
- paging is not working properly on news archives page [duplicate]
- How can I set up the URL for a category archive for a custom post type?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Pagination not working for archive
- how to pass args for archive.php query?
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Remove plugin’s custom post type archive page and single pages [closed]
- Pagination not working only on Archive-Name.php using new WP_Query
- Remove date rewrite rule for custom post type archive page
- how can i call archive-{post type}.php template from my custom plugins to my theams?
- Advanced archive url structure (category, tag and date)
- Content in WP Editor displayed below CPT shortcode [duplicate]
- How add column from new table in Custom Post Listing (admin)
- Writing a custom Glossary plugin
- Best way for a plugin to define a custom post type archive template?
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- Specifying a template for custom post type pages
- How can I increase the post count for custom post types only?
- How can I tell if I’m on a custom post type archive page?
- Listing authors and date archive from custom post type
- Pages not appearing?
- Limiting Amount of Posts in a Custom Post Type again
- Limit Amount of Pages users can create in Custom Post Types
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- restricting custom rewrite to just one custom post type
- Mandatory field in Custom post