• Resolved johnflufin

    (@johnflufin)


    I setup a custom post type (products) and a custom taxonomy (product-categories). I would like this url structure: domain.com/category-name/subcategory-name/post-slug (no base).

    If I understand the post-type and taxonomy rewrite settings, I have configured them to do what I’m wanting. But no matter what I set them to, I can only get domain.com/products/post-slug (no categories). I can change the base slug with the Custom Rewrite Slug field but I can’t figure out how to exclude the base slug and include category hierarchy.

    If it matters, settings > permalinks is set to custom structure: /%category%/%postname%/ and category base is set to “.”. Though I’m not sure if that applies to anything but standard posts(?).

    What am I missing here? Do I still need to add function code or a permalink plugin to get this to work?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    For customized permalinks like this, we recommend making use of https://www.ads-software.com/plugins/permalink-manager/ as CPTUI doesn’t handle the extent that you’re looking for. We would only be handling the slug values for the post type and taxonomy in their respective parts.

    Thread Starter johnflufin

    (@johnflufin)

    Thank you for the quick reply.

    Can you please explain what “With Front” does in CPT settings? Because it doesn’t seem to do what it says. At least not based on my interpretation – remove “products” from the url

    Also do the settings defined in settings > permalink affect custom post types and taxonomies? Or do they only affect the standard stock post type and taxonomy?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’ve never fully understood the intricate details about “With Front”, to be honest. At least based on the register_post_type() documentation its this:

    Whether the permastruct should be prepended with WP_Rewrite::$front.

    However, an older resource, before the developer.www.ads-software.com site came around says this:

    Should the permastruct be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true

    So I don’t believe it is related to the post type’s slug, but other potential parts of a given URL/site.

    From what I’m seeing, not so much with the Settings > Permalinks. I’ve toyed with a few of the date based options and my CPT permalink isn’t reflecting the dates. Googling is turning up tutorials about that with one i found being from as recent as 2021, so I have to believe custom post types don’t typically get dates, as an example.

    Thread Starter johnflufin

    (@johnflufin)

    I can’t seem to get Permalink Manager to work either. I set the Products post-type to “%product-categories%/%postname%” and it’s still using “products/post-slug” instead of “category/subcategory/post-slug”

    I tried various permastructure tags, changing CPTUI rewrite settings for Products post type, flushing permalink cache and disabling all other plugins to rule out conflicts.

    Any ideas?

    //////////////////////////////////////////////////
    UPDATE

    I finally figured out the issue. I went to the plugin settings and changed Permalink update to “Auto-update custom permalinks” and then went to the posts and set them to “Use Default custom permalink”. They were set to use custom permalink by default.

    • This reply was modified 9 months ago by johnflufin.
    • This reply was modified 9 months ago by johnflufin.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Awesome to hear that it looks like you got a working solution.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Rewrite settings not working?’ is closed to new replies.