Custom post types still giving me a 404
-
From trawling the support forum and blogs I see that a fair few people other than myself are having difficulties with custom post types and permanlinks.
My custom post type (diary) registers ok and all appears fine on the admin side. If you search for it on the front end it appears in the search results. However I get a 404 when I click through to the diary post.
Code is in my Pastebin here.
I have tried the following suggested solutions from various posts without any success:
- Re-saving my permalinks
- Changing ‘rewrite’ to just ‘true’
- Both ‘with_front’ => false and ‘with_front’ => true
- Adding flush_rewrite_rules(); after register_post_type
- Checking there are no pages or posts named ‘diary’
Even if I try to access a post via the default permalink structure such as https://localhost/?diary_post=my-title-here I have no success.
My permalink structure for the site is currently `/%year%/%postname%
` – changing this to the default setting doesn’t help either.Any clues? At my wit’s end here.
- The topic ‘Custom post types still giving me a 404’ is closed to new replies.