Custom rewrite tags have to be added before they can be used in permalinks, otherwise WP will not be able to parse those rules.
function your_init_function(){
add_rewrite_tag( '%category_type%', '([^&]+)' );
// register your post type....
}
Related Posts:
- WordPress page not showing up – replaced with last 10 posts?
- Redeclare/Change Slug of a Plugin’s Custom Post Type
- Custom Post type & Taxonomy URL structure
- Slug Formatting : Acceptable Characters?
- Disable permalink on custom post type
- Combining Multiple Taxonomies in one URL
- Change slug of registered custom post type in child theme
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- How to achieve this permalink -> category-name/custom-post-type-name/post-name
- Make permalinks based on an ACF-field
- ACF Relationships in Custom Post Type Permalink
- Prepend meta_value to permalink of post
- Remove Slug from Custom Post Type results in 404
- Remove taxonomy slug when not assigning taxonomy with custom post types
- Can’t edit Custom Post Type slug/permalink
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Taxonomy breaking pages permalinks
- How to Display ACF Relationship Custom Field as Link to Specific Custom Post?
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Automaticly add slug to posts
- How do I fix permalinks for custom post types that has the same slug as a page?
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Why does wordpress keep adding postname to my CPT’s permalink in the end?
- Wrong generated page_name/slug on first publish of custom post type
- Remove post type slug of all post types from permalinks
- Stop / prevent WordPress from updating permalinks of custom post type
- Change custom post type slug from plugin options
- Child post with numeric only slug keeps redirecting to parent
- How to add a post slug to a url?
- Permalink for a custom post type isn’t working and I don’t know why
- How to target a specific custom post type post and its all children and grandchildren?
- Assign same parrent Page to pages AND custom post types
- Create a custom php page and load it at a specific slug
- CPT archive admin menu label
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- How to change permalink to include custom post type
- Custom Post Type – Duplicate Page Slugs
- Redirect to another page using contact form 7? [closed]
- Remove permalink for custom post type
- How do you create %post_type%/%postname%/ permalink structure?
- Change Slug of a Custom Post Type
- How to inherit field value from parent post into in child / sub post
- Create short URL with auto 301 redirect
- Custom Post Type Advanced Slug
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- Custom Post Type to replace Woocommerce products – page not found error
- Custom Post Type with Configurable Sidebar via ACF
- Need to return a string as permalink insted of str_replace
- Under What Conditions Can I name my CPT the same as my CPT Page?
- Excerpt length: get first paragraph
- Custom post ID & display information related to this ID
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- WordPress URL rewrites using Advanced Custom Field
- Change permalink incrementor into pseudo-subdirectory
- Some permalinks on Apache/localhost development setup return 404’s when set to anything other than plain permalinks
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Two CPT: one is using part of the custom rewrite slug from the other
- Post Custom & Taxonomy 404 error
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Can I override the permalink/slug on creation
- Get full control over custom post type url
- Add category slug as class attribute in a link array
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Get post id of permalink for a specific custom post type?
- Can’t make permalink of CPT work
- How to make nested custom post type slugs work
- Can’t preview custom post – Redirected to home page
- How to I add count of custom posts listed in a post as a prefix to its title
- Hide custom post type slug url from search engine [closed]
- Custom post type Premalinks main page and details page
- Is it possible to use a post name in a custom post slug?
- How to change permalink structure off default posts and also CPT’s posts
- How do I get the permalink of a custom post type?
- Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
- How do I add a custom post type to the Featured Content in twenty fourteen theme?
- Custom post type loops with different page templates
- Get slug to point to different content of the same post
- Using custom post type parent as slug
- How To Enable Block Editor (Gutenberg) for Existing Post Type via functions.php
- Possible for Category Base and Custom post Type to share the same slug/permalink?
- Removing parent slug in hierachial custom post type
- Why doesn’t a custom post type permalink ever hit index.php
- Order post by date with ACF
- Template not working for the custom Post type
- How to find a specific post_type using its “rewrite slug”?
- Loop increase number
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Using WP meta query to show custom post types by a start and finish date
- Change permalinks for custom post type based on taxonomy term
- How to prefix custom post type URL with custom post taxonomy term?
- Recovering data about custom post and taxonomy types
- Custom permalink with custom taxonomies for custom post type
- Problem to get the link of the default ‘post’ post type like the orther custom types
- Get the custom post type slug but remove the rewrite prefix?
- Remove sequential number from permalinks
- custom post type archive slug vs. custom page template
- Posts picking up old Permalinks, how to reset?
- How to make a non-public post on wordpress approval?
- Custom Post Type slug has the same Redirection entry