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

    (@tw2113)

    The BenchPresser

    Outside of possible invalid characters in the rewrite slug provided, or slug clashing with something else, I’m honestly not sure why it’s not self-fixing after the permalinks flush. It’s one of those issues that tends to be case-by-case.

    What slug are you using for the rewrite rules?

    Thread Starter nstampler

    (@nstampler)

    Thanks for your quick response! (Very impressive!)

    The post type slug is “parshaclass”, and the custom rewrite slug is “parsha”. I tried a few different custom rewrite slugs, and none worked. FYI, here are the settings for that custom post type:

    name: parshaclass
    label: Parsha Classes
    singular_label: Parsha Class
    description:
    public: true
    show_ui: true
    has_archive: true
    has_archive_string:
    exclude_from_search: false
    capability_type: post
    hierarchical: false
    rewrite: true
    rewrite_slug: parsha
    rewrite_withfront: false
    query_var: true
    menu_position: 21
    show_in_menu: true
    show_in_menu_string:
    menu_icon:
    custom_supports:

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm. Not seeing anything obvious or glaring there. I was able to create my own copy and it’s doing just fine with regards to permalinks, so something else in your install must be going on.

    There’s no spaces or invalid characters in any part, so that’s good.

    Just on the sheer chance, could you try using the “Get Code” section of the import/export page and see if it persists if you register the post type via your theme’s functions.php file? Let me know if you have any questions or concerns about that part.

    Thread Starter nstampler

    (@nstampler)

    Sorry about the delay here. I tried using the Get Code and pasting it into my functions.php, but it didn’t help. I researched this on google and bit and tried a few other things, but didn’t get anywhere.

    Maybe this add’l info will shed some light on my issue:

    1. You mentioned above “or slug clashing with something else”. So the truth is that this originally was my only CPT. Then, I created a second CPT with the same “slug”, not realizing that this would mess up the permalinks for the first CPT. So I renamed the slug for the first CPT, but since then the permalinks don’t work for that CPT. Does that help you understand how to fix the problem?

    2. Also, only this CPT has the permalink slug section hidden on the add/edit post page. My other CPT, and regular posts/pages all have the permalink slug section displaying, and permalinks working. If I use my Developer Tools browser add-on, I can see that there is a CSS class embedded on the edit page for only this CPT:
    #edit-slug-box {display: none;}
    I have no idea where that CSS is being generated from! If I comment it out (via Developer’s Tools), the slug reappears. But no matter what I change the permalink to, when I resave the page and try to visit the page, I get a 404 error.

    I will be thrilled if you can help me fix this!

    Thanks for your help,

    NS

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Forgot to mention you’d want to remove the CPTUI post type so that it’s not getting registered twice, though it would be with the exact same settings.

    1. No that doesn’t shed any new light on things, sadly.
    2. That sounds more like the slugs for the posts in the post type, not the slug for the post type itself.

    Thread Starter nstampler

    (@nstampler)

    It suddenly hit me what the problem is! The slug that I’m using for this CPT is already used as the slug of a custom taxonomy! I quickly changed the slug to something else, and suddenly all permalinks are working. I can’t believe that I spent *hours* working on debugging this, when the problem was so obvious… :-/

    Thanks again for your help!

    NS

    Thread Starter nstampler

    (@nstampler)

    And btw, I figured out that the unwanted “#edit-slug-box {display: none;}” CSS was generated by the Adv. Custom Fields plugin, and I easily changed that setting to restore the permalink option.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Aha. That does make sense. So many things you want to avoid naming the same, for the sake of removing conflicts like this.

    Good to hear you got it figured out as well.

    After login on wp-admin

    -> Visiting the permalinks page
    -> Clicking save.
    Need to reset them.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Permalinks broken after updating custom rewrite slug’ is closed to new replies.