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

    (@tw2113)

    The BenchPresser

    Really hard to say what may be going on there as we don’t influence anything around permalinks, outside of on update/delete of a content type via our settings.

    Any changes to WordPress version or the addition of other new plugins around the time you noticed this starting to happen?

    Thread Starter Design Hero

    (@designhero)

    thanks Michael

    No recent changes or updates!

    Surely CPT UI generates the PHP code used to set the permalinks for new custom post types:

    ie:
    https://pasteboard.co/CDvDjW7A210P.png

    it looks like for some reason it’s no longer creating the code needed to set a custom rewrite rule to change the URLs for the archive for “Project” or the URLs for the single “project”

    where would I find the code the CPT UI generates so I can check if somethings gone wrong?

    UPDATE:

    by turning on “rewrite” to true, I have managed to get the URL for the archive correctly showing as “https://www.design-hero.com/success-stories/

    the custom taxonomy URL is also now showing correctly ie
    https://www.design-hero.com/success-stories/construction/

    but the single post, although the ULR looks correct, is resulting in a 404:
    https://www.design-hero.com/success-stories/construction/ttag-construction/

    what do you think?

    • This reply was modified 2 months, 2 weeks ago by Design Hero.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Yes, having rewrite set to true would be an important part of this overall.

    Regarding why the single permalink is still failing, i have to suspect custom rewrite rules attempts aren’t working.

    So you have your post type as “project” and i’m suspecting your rewrite slug for that has been set to “success-stories”?

    Is “construction” a parent post and “ttag-construction” a child post? or is any part of this a taxonomy term or similar?

    Thread Starter Design Hero

    (@designhero)

    Thanks for your help Michael, i think we’re getting closer…

    so “construction” is actually a custom taxonomy

    so custom post type = “project” => rewritten as “success-stories”
    example ‘TTag construction’ , ‘Azen’

    custom taxonomy = “project_sector”
    example ‘construction‘, ‘health-fitness’

    so the correct URL should be
    https://www.design-hero.com/{custom-post-slug}/{project_sector}/{single-post-title}
    =
    https://www.design-hero.com/success-stories/construction/ttag-construction/
    or
    https://www.design-hero.com/success-stories/health-fitness/azen/

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You’re going to want to look in to where/what code you were using to get that permalink structure, as we don’t have anything that’d give that type out of box.

    I know it’s a semi-frequent request for how to get say taxonomy terms into single post permalinks, but we don’t have the code to do that, and presently don’t have plans to try to. We’d only be able to help with customizing the individual parts, like you’ve done with setting the post type rewrite slug to “success-stories”.

    Since we found them, we often recommend https://www.ads-software.com/plugins/permalink-manager/ for permalink customization.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.