Open bobbingwide opened 2 years ago
Permalink structure | CPT | CPT name | Duplicate type | Duplicate post name | Permalink | Content retrieved |
---|---|---|---|---|---|---|
/%postname%/%post_id%/ | hierarchical | h1 | page | hierarchical | s.b/cwiccer/hierarrchical/ | Archive for CPT |
/%postname%/%post_id%/ | hierarchical | h1 | page | hierarchical/h1 | s.b/cwiccer/hierarrchical/h1/ | Archive for CPT |
/%postname%/%post_id%/ | hierarchical | h1 | post | hierarchical | s.b/cwiccer/hierarchical/3592/ | 404 |
/%postname%/ | hierarchical | hierarchical | page | hierarchical | s.b/cwiccer/hierarchical/ | Archive for CPT |
/%postname%/ | hierarchical | h1 | page | hierarchical/h1 | s.b/cwiccer/hierarchical/h1/ | hierarchical post |
/%postname%/ | hierarchical | hierarchical | post | hierarchical | s.b/cwiccer/hierarchical | Archive for CPT |
Things get a bit wierder when the hierarchical
CPT is configured as Exclude from search
and you perform a search. None of the hierarchical
posts are listed but clicking on any of the posts that are returned with the hierarchical
slug takes you to the Archive.
It would appear that regardless of the permalink structure, if you create a page with the same name as the rewrite slug for a custom post type which
has_archive
, then the custom post type's archive is displayed instead of the unique post.eg for CPT
hierarchical
viewing the permalink for the page namehierarchical
. Post ID 3588. Post typepage
gives the Archive template for the URLhttps://s.b/cwiccer/hierarchical/
.This was with permalink structure:
/%postname%/%post_id%/
For a duplicate post we get a 404. eg Post 3592 permalink
https://s.b/cwiccer/hierarchical/3592/