WordPress can handle this automatically by creating a page called
archive-CustomPostTypePage.php through register_post_type() function.
eg. archive-documents.php
You need to register your post type in the functions and the name has to be the same as the php file name above eg:
register_post_type('documents', array(
// YOUR ARRAY HERE
));
Related Posts:
- How to change permalink structure for custom post type and it’s taxonomies?
- How do I append multiple taxonomies to the URL?
- Taxonomy term in permalink
- Disable Single Post View for Specific Taxonomy on Custom Post Type
- Disable WordPress Recognizing Path as Attachment
- Custom Post Type: How to display all of same taxonomy?
- Remove “-2” from a Toolset Types URL with the same post name
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Permalinks for Taxonomy and Custom Post Type
- Update permalinks when new category added to custom post type taxonomy
- How to organize hierarchical structure in custom post type with taxonomy (like with categories)
- Custom Post Type with modified permalink structure results in 404
- Using page title as a link to term archive
- How to use taxonomy term as permalink folder
- Duplicate slug/permalink issue while adding same post name
- Custom permalink structure for custom post types including multiple taxonomy
- Permalinks for a custom post type – with a page template (custom query) and taxonomy archive
- Custom Post Type Categories Not Maintaining URL structure any more
- Problems with custom post type and hierarchical permalinks
- Is it possible for post and custom post type to share a category base slug?
- Custom Taxonomy as checkbox or dropdown
- Change slug of registered custom post type in child theme
- Templates for Custom Post Types and Custom Taxonomies
- Custom post type permalink changing itself every other change
- Add links to post categories and taxonomies in wysiwyg link modal?
- Removing parent slug from URL on custom post type
- Query multiple taxonomy in Custom Post Type
- Rewrite on custom post type permalink not working?
- Remove POST_TYPE from custom post type permalink
- Custom post type with specific category structure
- Custom post types and permalink
- custom post type default permalink
- Custom Post Type and Taxonomy combination
- Custom post types, taxonomies, and permalinks
- How to specify URLS for custom posts & taxonomies
- Get Post Primary Category
- How to check the terms in single custom post type template
- How can I move a custom taxonomy and its data from one post type to another?
- Custom Taxonomies not appearing in Admin
- Custom Post Type permalink shows wrong page: homepage/index.php
- Get term name and term parent into custom post type permalink
- Rewrite rules for custom posts types
- Does WordPress consider a post name unique if that same post name is in multiple Post Types?
- Can taxonomies of custom post types be used with category actions?
- how can I register a post_meta field in an existing CPT and then call it again with get_post_custom()?
- Custom post type as home page with custom url
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- CPT’s with landing page instead of archive – Url Rewrite?
- Hierarchical permalinks for custom post type and taxonomy
- Custom Post Type – Duplicate Page Slugs
- Remove permalink for custom post type
- Best way to specify “article type” in URL
- Rename a slug label
- Custom Taxonomy Category link
- Get Post Terms of Current Post (selected taxonomy term) – How to get only the taxonomy value and not “Array ( [0] => taxonomy term )” in the frontend?
- How to have permalink like domain.com/term/postname?
- Need help deciding on a taxonomy
- Pagination hitting 404 page on /page/4
- Custom post type slug 404
- WordPress multisite – is it possible to have different taxonomies for each site?
- How to filter a custom post type by custom taxonomy without 404
- How to show list of taxonomy terms associated with specific post?
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- Group Custom post type in a taxonomy page by its child taxomony
- Pagination of custom post type leads to 404 error
- WordPress Custom URLs
- Custom taxonomy query showing more than 4 posts
- Custom Post Types – Taxonomy and Customization
- wp_dropdown_pages with tax_query clause
- Custom Post Type nest under a normal WordPress Page
- Building a Data Intensive Website with WordPress
- Custom post type, taxonomy and admin bar
- Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?
- Change permalink for custom post type?
- Use a different URL path / permalink for CPT
- Do post types share the same records using the same taxonomy?
- Custom post type archive page filters
- get taxonomies from terms
- Taxonomy counter on Taxonomy List(plugin)
- Get all posts for custom taxonomy term
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- % encoded URL giving 404 error in WordPress
- Issue with Custom Post Types and Permalinks
- How can i remove post type archive URL?
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Multiple Custom Post Type with different Taxonomies
- Links Image in “Catalog” Page to Posts
- Why does my plugin require a permalink reset after a new installation?
- Connect 8 Taxonomies to One (Main) taxonomy. How to?
- Filter By Term Not Working – Custom Post Type
- How to have permalink structure based on taxonomy terms
- Custom post type permalink issue [duplicate]
- Multiple post types or single post type with category taxonomy?
- How to switch from custom post type URL to category URL?
- Custom Post Type with /%shop_name%/gallery/%gallery% permastruct?
- category_name not working in WP_Query
- Storing postID in session variable to query database when visitor on custom template page
- Permalink for Custom Post Types
- List custom taxonomy terms
- Show custom category archive as front page and remove taxonomy slug from urls