1

I use a plugin called CPT-onomies to create Custom Post Types. I created a post type called "case", and set "Has Archive Page" to true, but when i try to view a single case, i just get 404'd. Same thing also happens if i try to view the actual archive, eg. "site.com/case" and not "site.com/case/case-item".

Here's a screenshot of my settings: https://i.sstatic.net/VOoB1.png

I've tried disabling/enablind it, no success. I also tried changing permalink structure of the whole site (from settings -> permalinks) because sometimes that doesn't update.

Have i missed something in the settings or is this a bug in the plugin? I've gone through it several times and i can't find anything that would prevent it from working.

I have a template file called single.php that should be used. I also tried single-case.php but that didn't make any difference.

Solution

I found a solution here: http://gabrieleromanato.name/wordpress-fix-the-404-error-on-custom-post-types/

15
  • I have this similar problem before, and it was resolved wordpress.stackexchange.com/questions/99538/…
    – markyeoj
    Commented May 22, 2013 at 13:03
  • I tried manually setting the rewrite as you suggested, but that didn't work either (refreshed permalinks between). It should also not be needed because the plugin has it's own defaults. Have you looked at the screenshot? I'm really out of ideas...
    – qwerty
    Commented May 22, 2013 at 13:21
  • I checked your screenshot, try setting hierarchical to true. I am not familiar with CPT-onomies, but if you don't mind I I suggest you to switch to custom-post-type-ui
    – markyeoj
    Commented May 22, 2013 at 13:27
  • Still no luck after setting hierarchical to true. :/ This is my first time using the plugin, i just grabbed one of the top ones. I'll make sure to try another one next time, but i'm afraid i'm stuck with it for now (i've already added tons of content, if i remove the post types i can say goodbye to the content as well).
    – qwerty
    Commented May 22, 2013 at 13:37
  • If your plugin provides a registration code of your post type, it would be better if you will include it in your post. and make sure you have the following: archive-{post-type.php} - is for displaying the list of your post under your custom post type taxonomy-{taxonomy-name.php} is for displaying the list of your posts that belongs to your particular taxonomy name and single-{post-type.php} - for displaying single post of your particular custom post type.
    – markyeoj
    Commented May 22, 2013 at 13:48

1 Answer 1

8

I found a solution here: http://gabrieleromanato.name/wordpress-fix-the-404-error-on-custom-post-types/

Here's what you need to do to get it to work (quoted from site above):

  1. Go to Settings → Permalinks and change your current structure to: /%category%/%postname%
  2. Save changes.
  3. Restore your original permalink settings. Save changes.
3
  • This trick just worked for me as well... strange but true.
    – Eric
    Commented Aug 10, 2017 at 14:11
  • This worked for me. ugh after an hour looking into why it wasn't working. Commented Feb 3, 2019 at 21:45
  • That structure was actually my original structure -_- Commented Mar 26, 2021 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.