• Resolved ryanve

    (@ryanve)


    My WordPress installation is in the directory /blog/. I’ve successfully added the custom post type case_study in functions.php using this code: http://pastebin.com/rFwkfUmV

    which gave this permalink structure:

    /blog/?case_study=hello-world

    I changed the rewrite argument to

    'rewrite' => true,

    which successfully changed the permalink structure to:

    /blog/case_study/hello-world/

    but it gives a 404 error saying

    You tried going to …/blog/blog/case_study/hello-world/, and it doesn’t exist.

    I then modified it again like so:

    'rewrite' => array('slug' => 'case_study', 'with_front' => true, ),

    and still got the same 404.

    Any idea on how to fix this?

Viewing 1 replies (of 1 total)
  • Thread Starter ryanve

    (@ryanve)

    Problem solved by temporarily add flush_rewrite_rules(); as described here.
    I think the method in this article would work too: “Simply visit your Settings > Permalinks page. You don’t have to save your permalinks but just visit the page. This will flush your rewrite rules.”

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Post Type – Permalink 404’ is closed to new replies.