0

I'd like to be able to have multiple permalinks for the same underlying post (so if the post title is modified, the people still will find the page) - So, One URL will work with 3 different options. By post_id+postname or by post_id or by postname.

Here the examples:

That would be the full default URL.

http://www.example.com/my-custom-post-type/12/this-is-a-cool-article

but if we write just the Post_ID or the PostName, it should works too. like

http://www.example.com/my-custom-post-type/12/
http://www.example.com/my-custom-post-type/this-is-a-cool-article

so far, the full post URL with the Post_ID and the PostName works by following the tutorial Custom post types - Use post_id in permalink structure when using has_archive => true.

So I´m able to have an URL like:

http://www.example.com/my-custom-post-type/12/this-is-a-cool-article

and also can found the post with just the PostName like:

http://www.example.com/my-custom-post-type/this-is-a-cool-article

But if I do try to find the post by jus the Post_ID, do not works. I get an error page with the following URL:

http://www.example.com/my-custom-post-type/12/

Any help?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.