• Resolved peteruithoven2

    (@peteruithoven2)


    We’re running a website using CPT UI on Siteground which has a staging site feature. More info: https://my.siteground.com/support/tutorials/staging/

    We noticed that when we deployed our staging copy (staging62.ourdomain.nl to ourdomain.nl) suddenly all the custom post type pages returned 404’s.

    Previews of drafts did load, but they didn’t use the custom slugs (like /news/...) they where accessible under something like /?post_type=news&p=...&preview=true&_thumbnail_id=....

    Weirdly enough we did not have an issue on the staging copy, it was only after deploying the staging copy to the main domain we experienced this issue.
    (This will probably make the issue hard to debug)

    We solved it in the end by re-saving all the custom post types, but ideally that’s not something we have to do after every staging copy deploy.

    Wordpress version: 5.5.1
    Custom Post Type UI version: 1.8.1

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

    (@tw2113)

    The BenchPresser

    Feels like possibly a permalinks issue that would have potentially been fixed just by visiting the permalinks admin page once. Perhaps they weren’t flushed properly during deployments somehow.

    I do know that editing/saving a registered post type or taxonomy would also trigger a flush, so it’s also possible you would have only needed to do that one time, similar to visiting the permalinks admin page.

    Not really anything that I can see needing done on CPTUI’s end, unless I’m somehow missing a glaring thing.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Did you ever figure this out @peteruithoven2 ?

    Thread Starter peteruithoven2

    (@peteruithoven2)

    Thanks for checking in, we’ve not had to deploy a new staging site in the mean time. We’ll definitely try what you suggested:

    – Visiting the permalinks admin page once
    – Save one registered post type or taxonomy

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Sounds good. Thanks for the quick followup as well.

    Using this plugin with Advance Custom Fileds (ACF) and I get a 404 error when trying to use /%category%/%postname%/ settings in permalinks. But if I set the permalinks to default the custom post types work. Probably something simple. This is the first time I have used this what am I missing?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    @art137 so:

    CPTUI installed and active
    ACF installed and active.

    A post type registered with CPTUI, and a post created in that post type.

    When viewing the post on the frontend, with that permalink structure, you’re getting a 404?

    Please fill in any missing details as well, so I can get a bigger picture overall.

    It’s conflicting with WooCommerce for some reason

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    what post types and/or taxonomies do you have registered?

    I have created 1 post type and no taxonomies and have created 4 posts

    name: paintings
    label: Paintings
    singular_label: Painting
    description: ""
    public: true
    publicly_queryable: true
    show_ui: true
    show_in_nav_menus: true
    delete_with_user: false
    show_in_rest: true
    rest_base: ""
    rest_controller_class: ""
    has_archive: true
    has_archive_string: ""
    exclude_from_search: false
    capability_type: post
    hierarchical: true
    rewrite: true
    rewrite_slug: ""
    rewrite_withfront: true
    query_var: true
    query_var_slug: ""
    menu_position: 5
    show_in_menu: true
    show_in_menu_string: ""
    menu_icon: dashicons-admin-home
    custom_supports: ""
    • This reply was modified 5 years, 1 month ago by art137.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm, nothing there that should be doing any interference with regards to WooCommerce, that I can see. So I’m not sure what to suggest here for you. Do you have product categories named “paintings” ? perhaps permalinks aren’t sure what to query for in this case.

    To confirm, you’re saying that when you disable WooCommerce, the issue goes away, and when you re-enable it, it comes back?

    That’s what I thought too but I have two-word product categories such as acrylic paintings, abstract paintings, etc. and only one post category called “Muse” This is a new site so there isn’t a lot of content in it yet. I have never had so many problems with this dev version of wordpress

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not sure at this point.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘404 on all custom post types’ is closed to new replies.