I have a simple task, change the url from vikatorr.ru/portfolio-view/aisuma/ to the url of this type vikatorr.ru/aisuma/ in arbitrary types of recording. However, I could not find in the documentation how to set it up using PHP. Tell me how to do this for the entire post type. As a result, 404 http://vikatorr.ru/banksalen/
/* Portfolio */ function my_post_type_portfolio() { register_post_type( 'portfolio', array( 'label' => theme_locals("portfolio"), 'singular_label' => theme_locals("portfolio"), '_builtin' => false, 'public' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'hierarchical' => true, 'capability_type' => 'page', 'menu_icon' => get_template_directory_uri() . '/includes/images/icon_portfolio.png', 'rewrite' => FALSE, 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'custom-fields', 'comments') ) ); register_taxonomy('portfolio_category', 'portfolio', array('hierarchical' => true, 'label' => theme_locals("categories"), 'singular_name' => theme_locals("category"), "rewrite" => true, "query_var" => true)); register_taxonomy('portfolio_tag', 'portfolio', array('hierarchical' => false, 'label' => theme_locals("tags"), 'singular_name' => theme_locals("tag"), 'rewrite' => true, 'query_var' => true)); } add_action('init', 'my_post_type_portfolio'); global $wp_rewrite; $projects_structure = '/%portfolio%/'; $wp_rewrite->add_rewrite_tag("%portfolio%", '([^/]+)', "\portfolio="); $wp_rewrite->add_permastruct('portfolio', $projects_structure, True);