You’ll need to add the year, month, and day portions to the post’s permalink in your post_link
callback:
$link = str_replace(
"https://wordpress.stackexchange.com/" . $pto->rewrite[ 'slug' ] . "https://wordpress.stackexchange.com/",
"https://wordpress.stackexchange.com/" . get_the_time( 'Y/m/d', $post ) . "https://wordpress.stackexchange.com/",
$link
);
This will return a permalink such as example.com/2014/07/02/post-name
.
You’ll have to adjust the logic in your pre_get_posts
callback so it handles the fact that the year, month, and day query vars will also be present.
Related Posts:
- Permalinks using event date (year & month) instead of publication date
- Custom post types, taxonomies, and permalinks
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Permalinks: custom post type -> custom taxonomy -> post
- Mixing custom post type and taxonomy rewrite structures?
- Resolve a custom post type name vs. page permalink conflict (same slug)
- Custom Post Type pages are “not found”
- Remove taxonomy slug from a custom hierarchical taxonomy permalink
- Adding categories to custom post type in permalink
- How do I get the permalink of a custom post type?
- Can a custom post type have a Parent Page?
- remove custom post type permalink
- How to rewrite URI of custom post type?
- Add extra parameters after permalink?
- Custom Post Type Archives by Year & Month?
- Rewriting a custom-post-type permalink with taxonomy term?
- Getting hierarchical custom post type permalinks to work just like pages
- Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?
- Add .html (dot HTML) extension to custom post types
- How to change permalink structure for custom post type and it’s taxonomies?
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- Nested custom post types with permalinks
- How to prefix post permalinks with /blog/ – without affecting custom post types?
- Change permalinks for posts but not for custom post types
- Custom Post Type Permalink / Rewrite not working immediately
- Set post date before 1970
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- How do I append multiple taxonomies to the URL?
- Custom rewrite rules for archive page and single post
- WordPress 3.3 custom post type with /%postname%/ permastruct?
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- How to remove slug from hierarchical custom types in 3.5.2
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Custom post types – Use post_id in permalink structure
- Custom Post type & Taxonomy URL structure
- Custom post type 404s with rewriting even after resetting permalinks
- Remove slug in taxonomy url
- Multiple post types – share same ReWrite slug?
- Taxonomy, Terms, and Template Files
- Removing unnecessary numbers appended to postname in permalinks
- How to order posts of a custom post type by date DESC in dashboard Admin?
- How to remove /blog/ prefix for custom post types in permalinks?
- Slug Formatting : Acceptable Characters?
- Disable permalink on custom post type
- Combining Multiple Taxonomies in one URL
- Custom post type permalink: only use %post_id% and remove %postname%
- Custom post types – Use post_id in permalink structure when using has_archive => true
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- Rewrite rule for Custom post type Monthly and Yearly archive
- WP_Query() show posts that end later than today
- Custom Post Type Permalink Page Not Found
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- Rewrite custom post type rss feed links
- Custom post type permalink is doesn’t show in admin
- Numeric slug on child post
- 404 on child page when parent page slug is identical to custom post type
- custom post type and custom taxonomy permalink
- How to handle a hierarchy with custom post types
- Taxonomy term in permalink
- Using /%postname% for a custom post type
- WordPress Custom Post Type is Matching on Partial Slug
- Custom Post Type Archives by Date with Custom Permalink
- ‘publicly_queryable’ => false not working as expected for custom post_type
- Why does a custom post type need the ”hierarchical’ args setting?
- Changing the URL Structure of a Paginated Custom Post
- Change slug of registered custom post type in child theme
- Is there a way to use regular categories with custom post types?
- Templates for Custom Post Types and Custom Taxonomies
- How to modify URL structures in custom post types and taxonomies or terms
- Adding meta values to permalink
- rewrite get parameter with custom post type
- Hierachical Custom post types permalinks not working
- Modify custom post type rewrite rules in a separate function
- WordPress search: pretty URLs (permalinks), custom post types and pagination
- Custom Posttype Inheritance (and url structure)
- Having a custom post slug that clashes with an existing directory
- Permalinks so that one custom post type appears to be a child of another, not working
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Uploading DB to server from local is not matching the post dates
- Create permalink structure for one taxonomy archive per custom post type
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Help with a TV series Rewrite structure
- Disable Single Post View for Specific Taxonomy on Custom Post Type
- How to achieve this permalink -> category-name/custom-post-type-name/post-name
- Slug for custom post type archive
- Custom permalinks
- Permalink for CPT with taxonomy
- array_pop() expects array, boolean given for $event_type_term ->slug
- Using %postname% tag with a Custom Permastruct creates 400 Bad Request Errors from the server
- post_type_link filter causes 404 on the CPT page it’s used on
- Can you have two CPTs with the same permalink structure?
- Understanding Permalinks on Custom Post Types
- custom post type permalinks with category and tags
- Permalink rewrite with custom post type and custom taxonomy
- Custom post type permalink changing itself every other change
- Make permalinks based on an ACF-field
- Custom permalink with pagination
- Add links to post categories and taxonomies in wysiwyg link modal?
- Remove unwanted part of permalink custom structure from CPT url?
- Custom post type’s get_permalink returns wrong url