Rewrite nested urls for custom post type
I find a solution thank you to the plugin: Monkeyman Rewrite Rule With this plugin I find when the rule failed, then I corrected it with these lines of code: add_action( ‘init’, ‘ab_category_rewrite_rules’ ); function ab_category_rewrite_rules() { add_rewrite_tag( ‘%category%’, ‘([^/]+)’, ‘category=’ ); add_permastruct( ‘category’, ‘/catalogs/%catalog%/%category%’, false ); add_rewrite_rule( ‘^category/([^/]+)/([^/]+)/?$’, ‘index.php?category=$matches[2]’, ‘top’ ); } add_action( ‘init’, … Read more