[wp-testers] custom post type permalinks

Otto otto at ottodestruct.com
Tue May 18 17:53:13 UTC 2010

On Mon, May 17, 2010 at 8:20 AM, Greg M Boone <boone.greg at gmail.com> wrote:
> Greetings,
> I've been reading almost everything I can find on creating custom post types, and wondering how to configure a custom post type so that it will match the same permalink structure specified in the wordpress settings. In the functions.php for
> 'rewrite' => true, generates: /post_type/post-title structure
> 'rewrite' => false, generates: /?podcast=post-title
> using array ('slug'...) would just generate a custom slug before the post title, and array ('with_front') doesn't seem to do anything since I don't have a prefixed structure.
> My custom structure specified is /%year%/%postname%/ does anyone know how to get a custom post type to follow this rule?
> --
> Greg

Yeah. You don't. That's not what "custom post types" do or are.

"Custom Post Types" are NOT "Posts". Think of them more like Pages.
They're more like Custom Content Types, really.

If you want something you post to:
- show up in "the blog"
- show up in the normal feeds
- fit with the normal permalink structure
- any of the above
... then you should not be using a Custom Post Type at all.

Custom Post Types have a URL of /slug/postname. The "with_front"
option lets you make that into /something/slug/postname, if you happen
to have a post permalink structure with a prefix on it (like
/text/%postname% or something). If you make your post type
hierarchical, then you can have hierarchy in the structure like Pages

But that's it. Custom Post Types are badly named because they are not
"posts" in any sense, and they do not fit into the normal post and
blog system at all. They are Pages.


More information about the wp-testers mailing list