Custom Post Type Permalink / Rewrite not working immediately

Use the function flush_rewrite_rules() for set the rewrite rules new, but not with your code on init-hook, only on activation plugin or theme! See more in my post: http://wpengineer.com/2044/custom-post-type-and-permalink/

global $wp_rewrite;
$wp_rewrite->flush_rules();

Flush rules only on activation (and deactivation). Don’t do it on any other hook.

register_activation_hook()

Leave a Comment