Custom Post Type displays Custom Template properly when ‘Draft’, but if ‘Published’ returns 404. Performing the same operations on a Live duplicate of the site (local is the dev version), the Custom Post displays as expected when Published - issue is specific to the Local environment.
I have only one site running on Local.
Are you able to create a new, plain WordPress site in Local and access it in a Browser?
Publish Custom Post, it 404s, Set to Draft, it displays correctly.
Which version of Local is being used?
What Operating System (OS) and OS version is being used?
- macOS Catalina
Attach the Local Log. See this Help Doc for instructions on how to do so:
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.