Note that you should use %<post type>%
in the slug
value, so if the post type is test_cpt
, then you would use %test_cpt%
as in /a/%test_cpt%/b/c
.
And moving the post name/slug to the middle or beginning in the permalink structure is actually pretty easy:
-
Register the post type:
// replace test_cpt with the correct post type register_post_type( 'test_cpt', $args );
-
Then after that, do this:
global $wp_rewrite; // replace test_cpt with the correct post type $wp_rewrite->extra_permastructs['test_cpt']['struct'] = '/a/%test_cpt%/b/c';
And remember to flush the rewrite rules which can be done just by visiting the permalink settings page.