[wp-hackers] Post name permalinks and default post types

Simon Blackbourn piemanek at gmail.com
Wed Feb 26 01:19:49 UTC 2014


> So, I was combing the internet on how to implement the elusive%postname%
> permalink for a custom post type.  I know that it can be done without a
> performance hit now but I  was running into issues on how to implement it.
>


I've just been experimenting with this today. This method is working for
me:
https://vip.wordpress.com/documentation/remove-the-slug-from-your-custom-post-type-permalinks/


Only thing tht might be a problem if there is a post of another post type
> with the same name, but I'm not sure how WP handles duplicate post names of
> different post types.
>


The default single.php template is used, but the loop will loop through to
show all posts with the same slug.

Apart from this, the only side effect I have so far discovered is that if
you trash one of the duplicate posts you will get a 404 for the other one
until you delete it permanently.

Cheers
Simon


More information about the wp-hackers mailing list