Well… I didn’t know that the expressions in the rewrite attribute of CPT must be registered in advance:
add_rewrite_tag('%baz%', '([^&/]+)');
Related Posts:
- Rewriting a custom-post-type permalink with taxonomy term?
- Remove custom post type slug from URL
- Custom post type, no need for single view, plus want permalink rewrites that include hash in URI
- Custom post type yearly/ monthly archive permalinks
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- How can I rewrite URLs to pass taxonomy and post type values to the query?
- Using /%postname% for a custom post type
- Changing the URL Structure of a Paginated Custom Post
- Removing base slug from hierarchical custom post type
- Rewriting ‘rewrite’ slug for custom post type used by plugin
- Adding meta values to permalink
- Custom post type taxonomies URL rewrite
- WordPress custom taxonomy URL rewrite on spelling errors
- How can i avoid the permalink start with ‘blog’ while using the custom post type?
- Custom Posttype Inheritance (and url structure)
- Permalinks so that one custom post type appears to be a child of another, not working
- Create permalink structure for one taxonomy archive per custom post type
- Adding %author% in custom post type URL structure?
- Custom post type’s get_permalink returns wrong url
- Custom post type permalink structure with the category also acting as an archive
- Prepend meta_value to permalink of post
- Defining a default page for custom post type
- Pass parameter to custom post type single while keeping clean url
- Rewrite custom post type url’s adding meta box values
- Multiple parameters in a custom post type url rewrite
- URL rewrite and navigation structure for wordpress custom post type
- Removing CPT slug from URL results in 404 error for archive page
- Many to Many Taxonomies or rewrite rules?
- How to properly prefix blog post URL’s
- remove post-name from title in custom post type
- Getting Post ID from slug during init
- Rewrite custom post & taxonomy to share same URL path
- how to use two permalinks for one custom post type
- Adding a date archive to Custom Post Type
- Custom Post Type/ Taxonomy URL rewrite
- Bulk 301 redirect for custom post type
- Custom Permalink Tag breaks Pagination
- how to get archive urls with same origin for custom types and terms?
- Permalinks for Taxonomy and Custom Post Type
- Share parent path between Custom Post Types and Pages?
- multiple url slug for single custom post type
- Pretty URLs for Custom Post Type & Custom Taxonomy with Duplicate Slugs on WPML
- Custom Post Type and Custom Taxonomy Permalinks
- Pagination problem
- Custom Post Type Post have a Child `Page` Post Type Post
- remove permalink “front part” for custom post type
- Query var removed after rewrite
- Change Permalink Structure for Tag.php template
- Change custom post type slugs, with category/taxonomy before post type name
- Add archive slug to default post post type
- Custom Post type and permalink settings
- Rewrite post type slug only for child theme
- wp_list_categories() – current-cat class also inside posts?
- Adding custom post category slug in permalink causes 404 error for pages and posts
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- How can I make the slug of the taxonomy also the slug of the custom post
- Set a CPT slug as a base name for all the taxonomies
- Custom taxonomy rewrite with query var returns %2F in URL
- Remove slug in URL custom post type
- Versioned Custom Post Type (Not the same as revisions)
- cpt and page sharing same base permalink
- Custom post Type, child of a Page?
- Hide or disallow default custom post type url?
- URL rewriting for CTP assigned entity
- Custom taxonomy returns 404
- Added Custom Post Type and the View Option Doesn’t Work
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Pretty URLs and custom post types
- 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
- Custom Post Type Advanced Slug
- How to constrain the results to a specific post_type on tag archive page?
- Pagination for custom post types – url rewriting
- 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
- 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?
- How to make “single post” permalink maintain it’s sub-page structure
- 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
- How Can a CPT in WordPress have a page 2 without an error?
- current_menu_parent for custom post type and custom url
- Remove sequential number from permalinks
- Parent cpt/child custom post type URL permalink relationship
- Custom post type and custom taxonomy archive inaccessible
- How to rewrite custom slugs that follow my rules
- What is the best way to relate different custom post types?
- Allow child pages with the same base as the CPT slug
- How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure
- How to make 2 (or more) custom post type post pages sit under the same slug?