• 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • if you find a solution to this please post it here, as many people are suffering with this problem and this has broken a lot of websites out there

    Moderator Dion Hulse

    (@dd32)

    Meta Developer

    The problem here for future reference, was the code in question had “‘publicly_queryable’ => false,” which prevents the post type from being queried publically (ie. from the front end).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom post types still giving me a 404’ is closed to new replies.