admin管理员组文章数量:1390931
I have an instance of WordPress with multiple custom post types created with the CPT UI plugin.
The posts for one of the custom post types are shown on the front end as 404s. The other custom post types are fine.
I've tried flushing permalinks, deleting and remaking the post type, disabling all plugins, changing my theme.
I'm not entirely sure what else to check.
Thanks in advance for your suggestions,
Nathan
I have an instance of WordPress with multiple custom post types created with the CPT UI plugin.
The posts for one of the custom post types are shown on the front end as 404s. The other custom post types are fine.
I've tried flushing permalinks, deleting and remaking the post type, disabling all plugins, changing my theme.
I'm not entirely sure what else to check.
Thanks in advance for your suggestions,
Nathan
Share Improve this question asked Mar 28, 2020 at 2:54 NathanNathan 282 bronze badges 6- There has to be something wrong with your configuration can you post more info, maybe a screen capture of what you’ve set up? – Tony Djukic Commented Mar 28, 2020 at 3:56
- In the CPT UI plugin all of the settings are set to default except 'Has Archive' which is set to 'True'. I have three different post types created, Projects, Movies & Downloads. Downloads is the one that doesn't work. It used to work and then a few days ago someone told me one of my pages was a 404. I'm unsure what happened. If I create new post types they're fine. If I create new posts under this post type, they're 404s on the front end. If I delete and remake the post type, all the data is still there and they're still 404s (I know this is because it's saved through use of the plugin). – Nathan Commented Apr 2, 2020 at 23:10
- Do the REST API base slug and Post Type Slug match? (I don't even know if that makes a difference in this instance but lets check.) – Tony Djukic Commented Apr 2, 2020 at 23:15
- So the REST API base slug was empty (as per the default settings). I updated it to be the same as the post type slug. Flushed permalinks again, still no change. I changed the post type slug to Files instead of Downloads and all is good, but if I switch it back to Downloads then it says that slug already exists and the posts disappear on the front end again. – Nathan Commented Apr 8, 2020 at 2:32
- So there’s a conflict with another plugin or another post-type then. Are you using WooCommerce on the site? – Tony Djukic Commented Apr 8, 2020 at 2:47
1 Answer
Reset to default 0Based on our discussion in the comments I think the issue you're experiencing is that you've got a slug conflict with WooCommerce 'downloads'. Your CPT isn't conflicting but the slug it's applying is probably conflicting with WooCommerce's slug for downloads.
To rectify this, simply prefix your slug or adjust it:
/dls/
/nthn_downloads/
/themename_downloads/
Anything of that sort that'll differentiate it from the download endpoint & urls that WooCommerce generates for downloadable products should be sufficient.
Using the CPT UI plugin you would just edit your Post-Type and scroll down to the area pictured here...
本文标签: Single posts for one CPT UI post type are 404s
版权声明:本文标题:Single posts for one CPT UI post type are 404s 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744584061a2614093.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论