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
- How do I get the permalink of a custom post type?
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- WordPress 3.3 custom post type with /%postname%/ permastruct?
- Custom Post type & Taxonomy URL structure
- How to order posts of a custom post type by date DESC in dashboard Admin?
- Slug Formatting : Acceptable Characters?
- Combining Multiple Taxonomies in one URL
- How to handle a hierarchy with custom post types
- Taxonomy term in permalink
- Custom Post Type Archives by Date with Custom Permalink
- Why does a custom post type need the ”hierarchical’ args setting?
- Modify custom post type rewrite rules in a separate function
- Slug for custom post type archive
- Permalink rewrite with custom post type and custom taxonomy
- Permalinks in Custom Post types
- Custom Post Type with Nested Taxonomy and Template Files
- Semantic URL Custom Post Type and Taxonomies permalinks
- Date query for a custom meta field
- Disable WordPress Recognizing Path as Attachment
- How to make an archive page displaying posts in a date range
- Custom permalink – append taxonomy name and term name at the end of permalink
- Passing parameters to WordPress static front page
- Possible for Category Base and Custom post Type to share the same slug/permalink?
- How much control do we have over CPT rewrite slugs? Can I create a “root” page for my CPT with out the page path, and then have paths for other pages?
- Removing parent slug in hierachial custom post type
- Wrong generated page_name/slug on first publish of custom post type
- Stop / prevent WordPress from updating permalinks of custom post type
- Custom post type and permalink issue
- How do I correct an incorrect permalink?
- Update permalinks when new category added to custom post type taxonomy
- Tag Archive for Custom-Post-Type Posts yielding 404 when permalinks set to postname
- Why doesn’t a custom post type permalink ever hit index.php
- Allow post/page hierarchy across different post types?
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- custom-taxonomy/post_name instead of the default post_type/post_name
- Custom Permalink to remove category word , keeping posts permalink with date?
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- Custom Post Type Permalink
- Permalinks for custom post type
- How to include term custom meta into the custom taxonomy term permalink structure
- Meta Query posts not showing on ending date of custom field
- How to order posts of a custom post type by date DESC in dashboard Admin?
- Custom permalinks rules don’t match and lost of query var in the process
- How to Create Template File for Parent Page of Custom Post Type
- Changed permalink structure of CPT – should I redirect?
- How to hyperlink content from archive page with custom post-type
- retrieve permalinks of posts inside custom post type by using post ID
- Custom post type permalink sends to 404.php
- Post will not load via ajax
- Template for custom post type when taxonomy is in the URL
- Custom Post Type posts, conflict with posts after add_rewrite_rule to top
- How to change base in tag URL for custom post type, to not use “Custom Structure” set in Permalinks setting?
- Combine multiple CPT names to create valid permalinks
- How to add a sub directory to WordPress single posts without affecting other post types?
- I am trying to get cutom post cout by month of current taxonmy term
- How to display a WordPress Custom Field only on a specific day of the week?
- Which is the neatest way to have homepage articles and a blog?
- Custom rewrite rules for /pastissues/%category%-%postname%.html
- Subpages Permalinks Issues
- Multiple permalinks for a single post with multiple taxonomies
- Stop displaying Permalink
- Permalink with hierarchy of Custom Post Types
- Rewrite URL for CPT to domain/post-name/post-id
- Custom Endpoint For Specific Custom Post Type
- How do you create pillar content pages?
- Custom permalink structure for custom post types including multiple taxonomy
- Custom post type single page returning 404 error when sharing archive url with custom taxonomy
- Customise Permalink Structure For Custom Post Types
- How to make “single post” permalink maintain it’s sub-page structure
- Two and more diffrent custom page type in one permalink
- Some permalinks on Apache/localhost development setup return 404’s when set to anything other than plain permalinks
- Page as parent for CPT and other pages
- Two CPT: one is using part of the custom rewrite slug from the other
- Custom permalink with custom taxonomies for custom post type
- Change the url of a custom post type to include taxonomy
- how to use two permalinks for one custom post type based on categories
- Can I override the permalink/slug on creation
- Multiple custom post type and permalink issue
- group posts by month/date ignore years
- Remove sequential number from permalinks
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- How to display custom post type ordered by a custom field date
- Have two (permalinks) urls for a same custom post type
- change precedence of permalink for post_types?
- Redirect permalinks after creating custom post types
- Parent cpt/child custom post type URL permalink relationship
- How to make nested custom post type slugs work
- Custom Post Type Permalinks Problem
- Problems with custom post type and hierarchical permalinks
- Custom Post Types and 404 Pages
- Posts picking up old Permalinks, how to reset?
- Remove slug from Custom Category Permalink + dual-category permalinks
- WordPress Set A Static Page/Template For All Sub-Pages
- Get permalink in custom post type loop doesn’t work
- What is the best way to relate different custom post types?
- How to display *block number* instead *date value* on WordPress posts?
- Modify permalink of CPT archive to support two taxonomies
- Allow child pages with the same base as the CPT slug