• Resolved rstackj

    (@rstackj)


    Hi Michael,

    I hope you can assist me on this:

    I’m using several custom post types, let’s say one is named “Cakes” for this example.
    I have a problem with the link structure that’s being created using these custom post types:

    If I create a post and add a category (let’s say “Strawberry Cake” and “Fruitcakes”), when viewing the post, the URL displays as espected:

    domain.com/cakes/fruitcakes/strawberry-cake

    What doesn’t work is if the user navigates to the “fruitcakes” archive.

    In this case the URL generated is as following:

    domain.com/fruitcakes

    instead of the more beautiful way I would expect:

    domain.com/cakes/fruitcakes

    I’ve been trying for ages to fix that but I (and a WordPress group I’m in) can’t figure it out.

    Any suggestion?

    Cheers,
    Julien

    • This topic was modified 4 years, 8 months ago by rstackj.
Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    The biggest issue with the /cakes/fruitcakes/ permalink, when “cakes” is the post type, and “fruitcakes” is a category term, is that the permalink is assuming “fruitcakes” is a post in the post type, and “strawberry-cake” was perhaps a child post.

    Not sure if you have some customizations or a different plugin in use that’s allowing to categories in single post URLs, but that’s my hunch at the moment.

    At least with the cake example, it does feel like it’s a good case for keeping it all within a post type instead of working with categories at the same time, at least for this hierarchy.

Viewing 1 replies (of 1 total)

The topic ‘CPT URL Structure’ is closed to new replies.