I have tested your code and it works just fine. The thing that I think you are missing is flushing the permalinks by going to WP Admin -> Settings -> Permalinks and click Save Changes
.
Related Posts:
- Archive page with multiple taxonomies rewrite
- How to Add Pages Under Custom Post Type URL Structure?
- wrong template for page of archive
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- Custom taxonomy archive slug overwrites static page
- Display results from two Custom Post Types in page template
- Custom Post Type Permalink / Rewrite not working immediately
- Displaying category archive of custom post types
- add_rewrite_endpoint() not working for custom post type archives
- Filter for “get_post_type_archive_link()”
- Permalinks so that one custom post type appears to be a child of another, not working
- 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
- How to achieve this permalink -> category-name/custom-post-type-name/post-name
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- WordPress Custom Post Type Category Page
- Prepend meta_value to permalink of post
- WordPress custom post type category pagination 404 Error
- Rewrite custom post type url’s adding meta box values
- Multiple parameters in a custom post type url rewrite
- Show Custom Post Type by Author
- Custom post type archive with pagination?
- Need help with complex custom post type setup
- WordPress monthly archive links result in 404
- Rewrite rules for custom post type ‘attached’ to another custom post type
- Disable single pages and archives and keep preview
- Custom post type with tags
- List custom post type but redirects to home page
- Custom Post Type with static page for archive
- how to get archive urls with same origin for custom types and terms?
- add_rewrite_endpoint() and Custom Post Type Archive
- Custom post type archive page pagination
- Need post_type_archive_title function but in ‘single’
- Second Custom Post Type Archive
- add_rewrite_rule and how to get the custom post into the worpress loop the correct way
- How to show the archive / post type description on Single templates
- is_main_query() not working for WP REST API
- Hierarchical Custom Post Types – Show only parent on tax archive?
- Archive page for taxonomy terms
- How can i change the output of posts_nav_link();
- Custom Post Type with archive page but no detail page
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- Adding Post id to the end of slug in a Custom Post Type
- Why is my site using index.php instead of archive?
- Custom post type archive page blank
- Custom taxonomy rewrite with query var returns %2F in URL
- cpt and page sharing same base permalink
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Archive for CPT
- Archieve.php not loading for custom post type
- Custom Post type & Taxonomy 404
- Dynamically insert an article at the top of a taxonomy archive – or?
- Archiving custom post content?
- Custom Post Type – Rewite Archive page
- Archive Page for Multiple Custom Post Types
- Can’t access private custom posttype single- or archives-page
- How to rewrite the post slug of a custom post type post
- Custom post types and custom variables — add_rewrite_tag() not working
- Add Custom Values to Permalinks Through Custom Fields and Posts
- Why do I need to register my custom post type a second time when flushing rewrite rules?
- 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
- Custom post rewrite rule not working
- Create a Custom Path to Archive
- Advanced archive url structure (category, tag and date)
- WordPress rewrite rule doesn’t work unless post category is explicitly called in regex
- How to make a post accessible from multiple post type slugs?
- Display all Categories except ones with a specific parent
- Archive per year of a custom post getting the wrong post
- Custom Post Type add_rewrite_rule
- Creating archive like functionality through birectional relationships
- Sudden 404 pages on product category archives
- How to show custom post count in archive page
- Do not show child pages within a file page
- Change CPT permalink to use the category
- add_rewrite_rule wordpress ignoring url pattern, wp rewrite not working
- Archive for custom taxonomy
- Custom post type categories giving 404
- Custom category taxonomy – archive page not showing up
- Pagination URL in Custom Content Type
- 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?
- date archive future posts
- Keep same archive.php for post from archive?
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Custom post type child page 404
- Custom post type rewrite with_front
- ‘Blog Archive’ suddenly appeared on custom post type; how to remove
- Permalink of Custom Post Type
- Stop header code from showing in category page?
- add_rewrite_rule not working in Custom Post Type UI Plugin
- Url rewrite with custom post type and taxonomy
- Paginate yearly archives for a custom post type
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- What is the best way to relate different custom post types?
- Dynamic WordPress rewrite rules for multiple custom post types
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query