• Over 7+ days, I’ve spent ~100hours working with custom post types & taxonomies across about 6 different test sites. After having read hundreds of tutorials and codex entries, I’ve come to the conclusion that WordPress cannot do URL structures properly for custom post types.

    I’d love to be wrong. I’m here to be shown/proven wrong. Because everything else I’ve learned about/done with WP has been pretty awesome. Flexible, easy, light – just really good.

    GOAL: create a custom post type and hierarchical taxonomy that will generate a URL structure just like the default WP cats & posts when your permalink is /%category%/%postname%/. That’s it.

    Has anyone done this without rewrite code that relies on identifying segment#X in a url? This approach fails if your URL structure is variable-depth (like default cats/posts).

    URL structures using default cats/posts are great. I want that. But with a custom post type & taxonomy. Prepended slugs? no problem! But the CPT URL requirements don’t appear to work *anywhere*. Hell, even the page hierarchy by default creates great url structures. But CPTs? They are incorrect.

    Look at these forums for example:

    Support base:   /support/
    Forums:         /support/forum/
    Specific forum: /support/forum/plugins-and-hacks

    This is great structurally! But it all falls over when we get to some actual CONTENT.

    Post in forum:   /support/topic/posterous-shutting-down-1?replies=1

    Logical structure: support -> forums -> forum-name -> post name
    According to URL : support -> topics -> post name

    I could say “it’s fine and it works” and it certainly is “pretty”, but it is also incorrect. This properly defined hierarchical structure is what categorisation is to achieve in the first place! But CPTs simply ignore it.

    The same goes for bbPress, MarketPress and I’m sure many other popular plugins that rely on CPTs.

    Has anyone managed to successfully clone the design/structure of the post type “post” and taxonomy “category” that ships with default WordPress?

  • The topic ‘Custom Post & Taxonomy URL structures done properly’ is closed to new replies.