I have create a custom post type, but I can't get the archive page running regardless the many attempt to flush the rewrite rules cache or to restart the apache server. All I get is a 404 error page.
I'm coding locally on a virtual machine, so can't really provide access to the site but it shouldn't be that complicate to solve. However, this is getting me crazy.
Any help?
Hi andreaM-3,
Are you using the latest version of Types?
Please try deactivate other plugins and switch to wordpress default theme, and test again.
Yest the latest version is in use. I have figured out the problem is when I use the Custom URL format to prepend posts with a slug and "virtually" nest it under a page level.
So I have this scenario.
/page/ <- this is a real WP page
and I want to obtain the following
/page/cptslug/ <- this should be the archive page of my CPT
As soon as I insert the following in the custom URL /pageCPTSlug, my custom post type stop working.
Any idea?
By flushing the rewirting rules I got the CPT working, but I still face a 404 problem when the slug is rewritten in the Advanced field
So I have
/page/ <- this is a real WP page
/cptslug/ <- this is the slug of my CPT that in my case is post-list
I want to obtain this
/page/cptslug/ <- archive page to be shown
or
/page/post-list/
So far only this works
/page/post-list/my-archived-post <- custom post type
whereas a 404 is returned when I try to access to
/page/post-list/
I have tried to create an archive.php page with the following combinations:
archive-post-list.php
archive-page-post-list.php
Any idea?
I figured out the problem. I was having an extra / at the beginning of the custom rewrite.