Opened 15 years ago
Closed 12 years ago
#14345 closed defect (bug) (fixed)
BUG: Changing permalinks to a custom structure returns 404 on custom post types
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Permalinks | Keywords: | has-patch commit 3.6-early |
Focuses: | Cc: |
Description
To replicate the bug, do this:
- Create a custom post type
- Enable permalinks with the following custom structure: /%category%/%postname%
- Save the settings
- Access your post's permalink: It will return a 404 page
- Go to permalink settings again (don't change anything) and Save the settings again.
- Access your post's permalink: It will go to the post.
If you save the first time, it's not registering the changes, unless you save the settings for the second time without making any changes.
Change History (15)
#2
@
14 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
Closing as workdforme, In the event that this is still a problem, please re-open it with more details on the registration.
#3
@
13 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
I want to report the same issue.
I have a custom post type book which is working as supposed to with the standard permalink structure '?book=aus-tranen-werden-kristalle'. Setting a permalink structure as /%postname%/ rewrites the URLs in the following manner: '/book/aus-tranen-werden-kristalle'. This URL is no more accessible and marked as 404.
Also, when featured image is introduced for that post type, it is displayed but with the incorrect template. I use different templates for custom post types and the book template is not applied here.
Calling the get_post_type() returns NULL or 'attachment'.
#4
@
13 years ago
Can you please post a minimal code sample which can be used to reproduce the problem? Specifically any code used for registering the post type, as well as flushing the rules.
While You're at it, check to see if it happens with no other plugins loaded.
#6
@
13 years ago
Related #18040 ?
That's what I was thinking of actually.
nofearinc: does it work as expected if you Hit Save on the permalinks options page again? - If so, this can be closed as a duplicate of the above.
#9
@
12 years ago
- Keywords needs-patch added; reporter-feedback removed
- Milestone changed from Awaiting Review to 3.5
How is the post type registering and flushing rules? This doesn't seem right. Rules get flushed on every request for options-permalink.php.