custom-post-type-permalinks icon indicating copy to clipboard operation
custom-post-type-permalinks copied to clipboard

Custom Post Type News 404

Open johnstew opened this issue 9 years ago • 3 comments

I have a custom post type called news. The original URL structure worked fine and looked like so:

http://mywebsite.com/news/my-news-post

The new structure I wanted it to be like this:

http://mywebsite.com/news/2016/06/14/my-news-post

This worked using the plugin at least I thought it did originally but when I actually navigate to that URL I get a 404. If I go to the original URL the page displays perfectly fine. Wondering if I have a configuration issue here or am missing something.

Thanks for any help!

johnstew avatar Jun 25 '16 18:06 johnstew

Running the flush_rewrite_rules after the register_post_type and register_taxonomy? If flush_rewrite_rules has been executed at the wrong timing, does not work properly.

Function Reference/flush rewrite rules « WordPress Codex

torounit avatar Jun 28 '16 21:06 torounit

I've found that the post type only 404s if it is hierarchical. If the post type is hierarchical=>true, then single post type pages referencing nested taxonomy terms indeed throw a 404 error.

danielshields avatar Sep 13 '16 14:09 danielshields

I tried changing it to hierachical => false and that did not seem to help me.

enkodellc avatar Oct 18 '18 07:10 enkodellc