Does the Import/Export area show anything in the right side textarea?
Not sure why nothing is showing up in the “Registered Post Types” area, unless somehow it’s not saving to the options table at all.
No, there’s nothing in the text box under Import/Export. How could I troubleshoot whether or not it’s saving to the options table?
If both textareas are empty outside of some generic message, then the options aren’t being saved for some reason. The question is why, and I don’t know as I’ve never seen that happen myself.
But when I go to add “Portfolio” again, it says it’s already registered. With the way the urls get structured, I need it to be /portfolio/
Any recommendation on where to go from here?
Also, this has happened to me before. What I did was delete and re-add the plugin. That didn’t work this time.
At this point, I’d double check your theme/plugins for any that may be using that post type slug. It also could be a page slug.
In the code, I check if it’s part of the CPTUI saved post types already, check if it’s a reserved slug from WP core, and check if it’s already been registered as a post type elsewhere. Then I compare to page slugs.
In this case, we know already that we don’t have any saved values from CPTUI, so it’s not that. “portfolio” isn’t going to be a reserved slug from core. So that leaves it being registered elsewhere, or matching a page slug.
Just out of curiosity, have you managed to save any other post types successfully? Or have you just been trying with “portfolio” since that’s the one you need?
My theme is custom and the only plugins I have are: Akismet and ACF. So it’s not a conflict there.
So are you saying that if I have a page slug “Portfolio” I can’t have a CPT called portfolio?
Yes I saved “Work” successfully but I can’t have it called that because of then the link will be domain.com/work, when I need it to be domain.com/portfolio
Correct. I’ve had support threads in the past regarding post type slugs and page slugs matching and causing confusing 404 errors, because WordPress ends up not querying for the expected thing and other issues. In the case of matching page slugs, is WP supposed to query for a page? or a post type archive?
I thought I could have a CPT that would be domain.com/portfolio/post-title AND have domain.com/portfolio (page). The CPT would live on the page “Portfolio.” Perhaps instead, I could use a taxonomy? Do taxonomies create archives?
I deleted the page and the post type is now registered. Is there an archive page option? I just need a hub for these posts that can have a URL that makes sense with the portfolio post type.
If you set the post type settings in CPTUI to say “has archive: true” then WordPress core should take care of the rest. Visiting domain.com/portfolio/ with a post type slug of “portfolio” and no page with a matching slug, would then show the post type archive.