Custom post type 404s with rewriting even after resetting permalinks
Step 1, add the rewrite tags for custom event year and month query vars, then register the event post type with those tags in the slug argument of the rewrite argument: function wpa83531_register_event_post_type(){ add_rewrite_tag(‘%event_year%’,'(\d+)’); add_rewrite_tag(‘%event_month%’,'(.+)’); register_post_type( ‘event’, array( ‘public’ => true, ‘rewrite’ => array( ‘slug’ => ‘events/%event_year%/%event_month%’ ), ‘has_archive’ => false, ‘hierarchical’ => false, ‘supports’ … Read more