Put this code in your functions.php
–
function the_dramatist_url_rewrite() {
global $wp_rewrite;
add_rewrite_tag('%sub%', '([^&]+)');
add_rewrite_rule(
'^events/%year%/%monthnum%/%day%/%postname%/?',
'index.php/events/%year%/%monthnum%/%day%/%postname%?sub=$matches[1]',
'top'
);
}
add_action('init', 'the_dramatist_url_rewrite', 10, 0);
The go to the permalinks page in the settings menu at dashboard and hit Save Changes
button. Hope this is gonna help.
Related Posts:
- display different template based on post type
- previous_post_link() and next_post_link() with a custom post type?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Setting a custom sub-path for blog without using pages?
- How to add custom content template part for a custom post type on main query using a plugin
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- How to set a fall back template for a custom post type in a plugin?
- Templates for Custom Post Types and Custom Taxonomies
- Page is defaulting to archive page and not designated template
- How to quickly switch custom post type singular template?
- How to list/show all custom post types regardless of category?
- How to query custom posts using a dynamic category
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Custom Post Type with Nested Taxonomy and Template Files
- Create Pages from Database
- Custom page type – template under page attributes?
- Custom post type loops with different page templates
- Include different loop templates in search query
- Remove header and footer but KEEP all css and js etc for a custom post template?
- WordPress Template Hierarchy
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Pagination Issue: Custom Post Type In Index
- Create second custom 404 page for selected post type
- is_page_template not working as expected
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- How to show the archive / post type description on Single templates
- Set up Custom-Post-Type Author Archive
- Template for custom post with custom taxonomy
- Content vs Template on custom post
- WordPress Doesn’t Generate Taxonomy Archive
- A case for Hierarchical Custom Posts
- Filter widget outputs
- Adding Page Templates to post but it ignored it
- Template for all categories of a custom post type?
- WordPress custom taxonomy template not working
- How to specify a template for a path like http://example.com/something?
- WordPress 3.9 not using custom template
- Template files for Custom Post Type and Taxonomy
- How to Create Template File for Parent Page of Custom Post Type
- Custom post_type search pages
- how to remove pages loading with the archive templates
- Custom Empty Results page for my Custom Post Type
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- make permalink go to a custom single.php file
- Creating Sections for Post Types
- Custom post types with categories in template
- How can I trace inconsistency in loading a template?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- assign different templates to custom post type with homepage loop
- Get template part with CPT and Custom Taxonomy conditionals
- Displaying a list of Contacts
- How to change single custom post template by custom taxonomy?
- Custom permalink structure for remote content pages
- Setting a homepage – doesn’t seem to work
- Custom post type draft use wrong template
- List of a specific Custom Post Type in Custom Template
- How can I add in post’s the text “No content”
- Require custom post type if is_admin() – template doesn’t show up?
- How to customize `Edit-Post` Screen
- Calling a div and content in php?
- Tag template not returning posts [closed]
- Function to allow single post template based on custom taxonomy?
- Shortcode in pages or tempate files for custom post type
- Specifying a template for custom post type pages
- Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?
- Custom post type set default template using block editor
- A certain theme is forcing it’s singular post layout
- Post template not applying on theme (potentially rendering as Page template)
- Custom post type defaults to index.php for archive page
- Custom Post Taxonomy Template Not Loading Properly
- Is it possible to link an external stylesheet, exclusively within a specific single post template?
- How do I force a CPT to select a shared custom template in Post Attributes?
- Templating advice sub posts of a CTP
- Question on templates
- Assign for all post of a post type a specific single-post template
- Custom post type option page template
- Taxonomy template file not working with a taxonomy that contains a slash
- How can I load Template file from wordpress plugin
- Templates for CPT not working
- How to override post-new.php with custom template
- How can I find out what template is my custom post type using?
- Can I organise my custom post types by page?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Redirect to different template other than single-custompost.php
- Custom Homepage As Single Page or Custom Post Type?
- WordPress Custom taxonomy template
- custom post type plugin – single template
- Use one template for different custom post types with the same markup
- Custom page template not being called
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- How can I pull information from my loop and divide them seperately?
- Custom template support for custom post type?
- Storing postID in session variable to query database when visitor on custom template page
- Custom Post Type Template Based on Page Slug?
- How to make a template for a specific post of a custom post type?
- WP_Query is getting the post but the_post() not rendering any Post
- Apply text based styling done for a single post in WPBakery to all posts / create a template out of it [closed]
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Custom post type is_singular condtional not working when managing sidebar display
- Why isn’t page attributes dropdown not showing up in a custom post type