This is exactly how wordpress works.
For each Custom Post type Create an archive-custom_post_type_name.php and a single-custom_post_type_name.php
WordPress automatically loads that file when someone goes to the url.
so if your custom posts types were koolio and notsokool then you would need these 4 files in your theme child (you’re using a child theme, right?!)
archive-koolio.php
single-koolio.php
archive-notsokool.php
single-koolio.php
I would take the single file out of your theme folder and copy it to your child them, then add the CPT extension. Do the same for the archive template.
rememeber you’ll have to flush the re-write rules if your plugin isn’t set to do this by itself…just go to seetings/permalinks and hit save.
Related Posts:
- Mixing custom post type and taxonomy rewrite structures?
- How to rewrite URI of custom post type?
- Custom rewrite rules for archive page and single post
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom post types – Use post_id in permalink structure
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Custom Post Type and Taxonomy URL rewrite
- Custom post type permalink: only use %post_id% and remove %postname%
- Rewrite custom post type rss feed links
- Add category to custom post URL
- Creating a custom public user page
- Archive page with multiple taxonomies rewrite
- rewrite get parameter with custom post type
- How to filter custom post type archive by meta value
- Taxonomy archives based on Custom Post Type
- Multiple custom post types using the same taxonomy = URL frustrations
- Taxonomy page returns 404 page not found
- Child pages on hierarchical Custom Post Types 404s
- Remove unwanted part of permalink custom structure from CPT url?
- How to have a custom URL structure for a custom post type?
- Permalinks for CPT breaks permalinks to pages
- WordPress custom post type url change
- Changing a custom post type “has_archive” after registered
- Possible to change the slug of default post type?
- Custom Post Type rewrite redirects to homepage
- Custom Post Type slug same as page name causing a conflict
- Adding paged query to custom URL rewrite
- Custom Post Type rewrite rules not working, how to alter the rewrite order?
- Rewrite Custom Post Type URL slug
- Customising rewrite rules for CPT single post URL to work as paged URL
- Remove custom post type slug not working for child pages
- Custom WP TItle from custom template with dynamic URL structure
- Rewrite rules for custom post type slug
- Change URL of posts and also Custom Post Type
- Conditional regex in add_rewrite_rule() for specific query filters & pagination
- Custom Post Type rewrite
- Relative URLs for a particular custom post type?
- Change custom post type slug from plugin options
- How can we take into account post types when constructing permalinks?
- 404 Issue w/ Custom Post Type – using Meta for Permalink rewrite
- Taxonomy custom post type URL
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Custom rewrite url category
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- How to add rewrite rule to custom post type with parent in url with cpt ui?
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- Custom Permalink to remove category word , keeping posts permalink with date?
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- Rewrite custom post type url – Multiple post types
- Rewrites/query for multiple hierarchical custom post types
- WordPress uses url different from defined in rewrite arg of custom post type
- Rewrite rule for Custom Post Type Page as a parent
- add_rewrite_rule and passing variables for custom post types
- Custom taxonomy and post type with same slug
- Permalink misbehaving in Custom Post Types
- Custom URLs in post types make it impossible to view archive
- Custom Permalinks for Custom Post Types
- Share root slug for Child Page and Custom Post Type (prioritizing child pages over posts)
- Route subpage to Custom Post Type
- Custom Post Type Category URL
- Add term slug in URL of custom post type details page
- Programmatically add custom field to post_name in a custom post type
- Custom Post Type Advanced Slug
- How to create custom search result page with custom URL parameters for custom post type?
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- How to constrain the results to a specific post_type on tag archive page?
- Pagination for custom post types – url rewriting
- Modifying rewrite rules to use /category//
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- Custom rewrite rule takes place AFTER the generic category rule
- returning the currect URL for nested posts
- Adding /blog in front of single posts (only)
- multiple URLS for the same page
- 404 error rewrite permalinks
- Custom rewrite rule based on other custom post type title
- How to apply multiple rewrite_rule to a single custom post type url?
- Define multiple prefixes for custom post type
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?
- Custom Post Type canonical link / pagination redirecting to root
- Rewrite url post_tag for custom post type
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- WordPress custom post type rewrite rule matches all pages returning 404
- Remove custom post type slug but keep related category taxonomy permalink
- page not found for example.com/custom-post-name
- Force WordPress to only match URL in category
- Custom post type with parent page? Possible?
- current_menu_parent for custom post type and custom url
- Why won’t this rewrite rule work?
- Cannot modify a registered custom post type rewrite slug
- Custom post type and custom taxonomy archive inaccessible
- Generating custom URL before post is published
- Custom post type permalink structure
- How can i change url structure of cpt like this?
- Looking for advice how to approach building a WordPress plug-in
- Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL
- Custom archive URL as a subfolder of the custom post type slug
- Custom slugs with dates & IDs on Custom Post Type
- Add post id to url instead of WordPress default -2 suffix